r/javascript • • Feb 05 '11

Are Semicolons Necessary in JavaScript?

http://aresemicolonsnecessaryinjavascript.com/
0 Upvotes

66 comments sorted by

View all comments

7

u/itsnotlupus beep boop Feb 06 '11

Meh. Are we going to have an "IsTheWithStatementWorkingInJavascript.com" next? Maybe I should rush to register "CanEvalReallyCompileScriptFragments.com" first.

I can see it now. Blurbs after blurbs of exposing the Lies of the Leaders, claiming those features are broken, when they clearly work. Read the spec, people!

Alright, fine, I'll be serious for a sec. Sure, you don't have to use semi-colons. The brokenness of magic semi-colon insertion rules on a multi-line return statement is pretty contrived, so you can totally be okay without them. In fact, if you're Isaac, you'll do just fine.

But if you're on my team, you're going to run jslint on every one of your source files many times a day. And any non-default jslint option is going to have a very good reason for being set. You see, my team has all kind of folks on it. Folks that have written in C++ for most of their lives. Folks that just graduated. It's a huge time saver to have one clear, non-debatable style for all our JS code. It's also a huge time saver to be able to express 80% of that style as "JSLint must like your code." - No lies.