r/javascript • • Feb 05 '11

Are Semicolons Necessary in JavaScript?

http://aresemicolonsnecessaryinjavascript.com/
0 Upvotes

66 comments sorted by

View all comments

12

u/iratefruit Feb 05 '11

In a language like javascript, where whitespace is not as restrictive as languages like python, I find that semicolons help with readability.

The case made here http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding with point 4 is still a valid reason to use semicolons.

Personally, when reading a line of code, it is nice to be able to read till the semicolon and know that it has definitely ended that statement. The author argues that having a semicolon in front is an improvement to readability. My opinion is that just isn't true. Since it would require me to read the second line in order to figure that out. A semicolon prefix gives me no useful information about the statement while scanning through my code.

I realize what i'm talking about might be unique to me. But I like my code pretty, unique, and regular (not with seemingly random semicolon prefixes).