D
Dan Evans
JavaScript isn't C.
function foo()
{ if (3 !== 3)
return false
}
Actually, I find the original formatting much nicer. Can you explain
why there's a blank line in the middle of yours? You may have reasons
for some of the things you did that come down to personal preference
but some of it is just bad. Not wrapping your conditional blocks in
curly braces makes code harder to read and maintain. Not ending your
statements with semicolons can lead to actual errors at run-time. As
for putting the opening brace of the function definition on a new line
and putting the if on the same line with it, if that's the style you
prefer then that's up to you but I don't think that it is "more
JavaScript" to write it that way, it is just your personal preference.
If there is some convention in C that is good (i.e. useful to keep
programmers from making mistakes or the code from behaving
unexpectedly) just because another language is not C does not mean
that the other language should abandon
I do wonder if your post was just a joke, that would make more sense
to me. If so it was a good illustration of bad formatting.