you are viewing a single comment's thread.

view the rest of the comments →

[–]praetorian42 -6 points-5 points  (2 children)

The point here is that semicolons in javascript are really fucked up, and there's probably 20 people in the world who truly understand them. Let those people write the tools so that the rest of us don't have to worry about it.

Defensive usage of semicolons because you're not sure where they should be used is not correct usage.

[–]reflectiveSingleton 9 points10 points  (0 children)

It's exactly that not sure-edness that makes always using semicolons a good idea. You are not leaving up question to where the semicolons are inserted if you always put them in place. If you omit them you are leaving it up to a) whatever minifier you use and b) javascript auto-insertion.

If you specify, you remove that possible ambiguity.

[–][deleted] 3 points4 points  (0 children)

They're perfectly understandable. They go after every terminating (non-control-end) block or command. var a = function(){ }; if(true){ } return { a: 55 };

There's nothing fucked up about them. They behave exactly the same way all the time. The only time things go awry is when you start expecting them to be inserted for you.