Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hide won't
Message
From
12/03/2014 11:43:05
 
 
General information
Forum:
Javascript
Category:
JQueryUI
Title:
Miscellaneous
Thread ID:
01596038
Message ID:
01596300
Views:
43
>>So, you're telling me that not only do I have to get lost in stupid '{'. '(' and ';' s but the engine could always just slip something in where it thinks it should be. Joy.
>>And I thought COBOL was freaky about the '.'
>>
>>Again, 'splain to me how this is so damn much better?
>
>I didn't say it was better - I thought pretty much everyone accepts that there are, and always have been, crap parts to JavaScript.
>
>But if you want to argue against the use of brackets in, for example, C# then I'll argue :-}

My biggest problem(s) with the '{' are that
1) They're WAY too easy to lose track of. If you absolutely must have something to designate the beginning and ending for a code chunk, what's wrong with 'begin' and 'end'? Much easier to keep track of
2) The fact that, because of 1, people will put them on separate lines, increasing the white space in a program and (to me) making it more difficult to read and to follow the logic flow. I have the same issue when people comment out huge swathes of code rather than remove it after a set period of time. Seriously, we've got programs that have 100's of lines that were commented out in 2005.

>
>Maybe watch this : https://www.youtube.com/watch?v=v2ifWcnQs6M&list=PL62E185BB8577B63D&index=2 (author if JLint) and the rest of the series which covers the good bits.
>
>At some point he makes an interesting observation : too many people start writing javascript without learning it.
>

Thanks - I'll take a look at it.

>>>There's a potential error if you place the opening brace on an empty line. Consider:
return
>>>{ x:1};
Javascript engines will often place an implied semi-colon after return
>>>
>>>>That is ridiculous about JSint. A code block's opening { being placed at the end of a line is a very common formatting style.
>>>>
>>>>>And yes, I'm getting the value I'm expecting - and it's NOT equal to 'custom', so it should be hiding the CustomCodes DIV section.
>>>>>
>>>>>But it's not.
>>>>>
>>>>>Notepad++ will also do that for you
>>>>>
>>>>>Also, I tried putting them on a separate line, but whenever I attempt to run the code to JSint it screams about the opening { not being on the same line as the code.
>>>>>
>>>>>
>>>>>>Try alert($('#RwrdCode').val()); to verify you're getting the value you expect.
>>>>>>
>>>>>>As for the {}, I suggest you put them on a new line to help see where they line up. If you are using Visual Studio, you can place the cursor after one, and it will highlight the matching begin or end bracket.
>>>>>>
>>>>>>>ok...got past the '=' vs '==' thing - also have fought through the stupid mis-matched '{' and '(' things ('splain to me how that's so much better than a simple 'begin' and 'end' if you insist on having to tell the compiler where a command starts and finishes)
>>>>>>>
>>>>>>>Now...for something completely different.... Hide won't
>>>>>>>
>>>>>>>
>>>>>>>$(function RewardOnChng(control) {                       
>>>>>>>alert("In RewardOnChng function"); 
>>>>>>> if ($('#RwrdCode').val() == 'custom'){
>>>>>>>        $('#CustomCodes').fadeIn();}
>>>>>>>      else{
>>>>>>>        $('#CustomCodes').hide();}
>>>>>>>
>>>>>>>
>>>>>>>This is on a dropdown list with a label and textbox for free entry on a certain value.
>>>>>>>
>>>>>>>"CustomCodes" is the [broket}DIV[/broket] definition for the label/textbox
>>>>>>>
>>>>>>>I know that it's going into the function, since the alert box shows....and that's all that happens, as far as I can tell.
>>>>>>>
>>>>>>>Why won't it hide?

v2ifWcnQs6M
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform