News for hackers. Stuff that matters.
Re:Actual drawbacks to omitting semi-colons? by nostromo on Tuesday October 05, 2010 @11:53PM (#1762630)
I always use semicolons in js because I usually compress the code down by removing superflous whitespace -- which would make this style of code not function at all.
Re:Actual drawbacks to omitting semi-colons? by mncaudill on Tuesday October 05, 2010 @11:55PM (#1762636)
The major compressors are syntax aware. When they compress your JS, they'll put in semicolons where needed.
Re:Actual drawbacks to omitting semi-colons? by suninwinter on Wednesday October 06, 2010 @01:02AM (#1762802)
A newline takes up just as many bytes as a semicolon.
Re:Actual drawbacks to omitting semi-colons? by masklinn on Wednesday October 06, 2010 @01:41AM (#1762864)
But if you have a newline you generally have an indent. Furthermore, there are places in JS where semicolons are absent and newlines are not (after braces).
Re:Actual drawbacks to omitting semi-colons? by pjscott on Wednesday October 06, 2010 @03:44AM (#1763103)
It's moot, anyway. Format your code for readability, and let a minifier handle making it smaller. Then let gzip finish the job.
Re:Actual drawbacks to omitting semi-colons? by pjscott on Wednesday October 06, 2010 @01:39AM (#1762860)
Unless you're using CR+LF as your newline delimiter.