>
> I think there are a large number of programmers who, because of those
> java style guidelines and the way ASI works, write javascript breaking
> before operators except for comma operators.
>
> http://www.google.com/codesearch?q=%5Cx20%5Cx20%5Cx20%5B%2B-%5D%5B
> ^%2B-%5D+lang%3Ajavascript
> shows numerous examples.
>
> If true, this is not just a matter of code backwards compatibility,
> but of porting programmers.
>
That's unfortunate. There's another option: Python-style. In Python, I
believe newlines are ignored within a parenthesized expression. In JS, that
would mean:
var a = 1
+ 2
// a = 1
var a = (1
+ 2)
// a = 3
If a large number of long lines happen to occur within function calls,
like...
log(longThing1 + otherLongThing
+ lastLongThing);
...then that will do the right thing without having to add more () just to
handle the newline.
- bob
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss