Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


The major compressors are syntax aware. When they compress your JS, they'll put in semicolons where needed.


A newline takes up just as many bytes as a semicolon.


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).


It's moot, anyway. Format your code for readability, and let a minifier handle making it smaller. Then let gzip finish the job.


Unless you're using CR+LF as your newline delimiter.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: