Closed NadyaNayme closed 9 years ago
Well. Knowing to use ;
before (
and [
if they come after a \n
, and not to do return\nvalue
is not necessarily something to be proud of. I'd rather have code be consistent (just using ;
everywhere), than having to bother following those rules.
Not really FUD, the rules are obtuse. The solution proposed by standard
, where the linter watches for these corner cases and tells you to patch them is pretty elegant, though. You're welcome to create a pull request citing this alternative
That's a rather over-complicated way of saying "never start a line with ( or [ "... The specifics aren't overly important in that regard as the simple and easy to remember rule would prevent the specific "gotchas!" although the specifics are still good to know to better your understanding of the Javascript parser.
Code would be consistent with or without ;
as long as it picked one style and stuck with it. ;)
Again, I don't care which people decide to use. So long as the code base is consistent. I actually prefer using ;
, however my reasoning to do so is aesthetic in purpose rather than being based on FUD (we're going to have to agree to disagree on the information surrounding ASI being FUD or not it seems)
I'll submit a PR as suggested sometime tomorrow that proposes using a linter to watch for the "gotcha!" as an easy-fix to any possible ASI issues of not using semi-colons.
To quote
standard
out of laziness:There is only a single rule that is a real "gotcha!" and memorizing a single rule is not "frivolous knowledge of ASI".
I'm impartial about whether to avoid or use semicolons. However spreading FUD as the reason to use them should not be how a responsible developer does it. It's largely a stylistic issue. Feel free to advocate for the use of semi-colons but please make sure you aren't doing so under false reasons.
Regardless, I'd take a programmer with frivolous knowledge of how a language actually parses and functions over one who doesn't any day of the week.
Relevant to above statement: http://www.slideshare.net/olvemaudal/deep-c