r/javascript • • Feb 05 '11

Are Semicolons Necessary in JavaScript?

http://aresemicolonsnecessaryinjavascript.com/
0 Upvotes

66 comments sorted by

View all comments

Show parent comments

0

u/sjs Feb 06 '11

The only reason few people are aware that you only need semis before lines beginning with ( and [ is because instead of educate people about the actual language all we seem to do is spread misinformation and FUD about semicolons in ES. It's so incredibly easy. That anyone thinks it's a lot to remember is utterly ridiculous. Doubly so in the context of software development. 1 measly rule, that's it.

Instead of saying "Sure use semis if you want, but be aware of ASI and that it may surprise you. Or leave them out except on lines beginning with ( and [, and be aware that ASI may surprise you sometimes. The canonical surprise cited is return\n{ but in practice nobody actually writes code like that so take the warning with a grain of salt.", we instead support this theory.

1

u/skeww Feb 06 '11

This isn't a religious issue. Don't try to make it look like one.

Since I'm not anonymous here (5 minutes of detective work will tell you that I'm Jos Hirth)... are you trying to say that you're a "total fuckwad"?

2

u/sjs Feb 06 '11

Sorry I'm honestly not trying to make this a religious issue. And I'm not anonymous either.

I don't care whether people use semis or not. It'd be like caring about brace style, it's purely aesthetic. I just don't like the misinformation.

Sami Samhuri

http://samhuri.net

http://twitter.com/_sjs

1

u/skeww Feb 06 '11

samhuri.net is a parked domain, in case you didn't notice.

1

u/sjs Feb 06 '11

Crap, I forgot about that. Waiting on the registar to sort that out (and to transfer the domain...), expired end of Jan and the reminders went to my old email address from school so I didn't notice until it was parked :/

https://github.com/samsonjs is the next best I've got.