> Does the "semicolon insertion" really affect you if you format code as[color=blue]
>
> function x (y)
> {
> // ...
> }
>
> instead of:
>
> function x (y) {
> // ...
> }
>
> The jslint page complains about lines ending in ) due to the nebulous
> idea of "semicolon insertion". I have not reviewed the ECMAScript pdf
> in great detail to try to pin this pretty-printing issue down. In
> general, I find that code formatted in the "K&R" style (opening brace
> on same line as if, while, function) confusing and difficult to read
> compared with placing curly braces on separate lines.[/color]
I like to avoid insecurities in languages. I prefer to work where the ice is
thickest. Since I am the one who wrote jslint, that's what it likes, too. But it
has a checkbox that you can clear that turns off that check.
Legibility is of paramount importance. If you find the K&R convention difficult
to read, then don't use it. One of the deficiencies of the C family is that
there is no ideal way to make them pretty. I think that should be an important
consideration in the design of syntax, but clearly I am not with the mainstream
on this.
http://www.crockford.com/javascript/lint.html