Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hide won't
Message
From
12/03/2014 12:16:25
 
 
To
12/03/2014 11:43:05
General information
Forum:
Javascript
Category:
JQueryUI
Title:
Miscellaneous
Thread ID:
01596038
Message ID:
01596309
Views:
40
1) Braces are used in C, C++, and Java. I much prefer them over begin end. Also, keep in mind that javascript has to be sent to the browser. {} is two characters (no whitespace needed). begin end is 8 (plus whitespace around them). If you have lots of javascript, that's lots more data to transfer, which takes more time. And, you can minify js files which essentially removes all CR/LF and lots of whitespace.

2) Whitespace adds to legibility. It's been proven in research.

I put { at the end of the line and } on a line by itself. If I type {, I also type } right after that. Also, a good editor will indent things properly.


>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.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform