Hacker News new | past | comments | ask | show | jobs | submit login

Nice article but, am I the only one shocked by the lack of semicolons in the given examples?



Try it! If you learn about why semicolons were recommended for js, it's pretty easy to avoid writing code that would land you in trouble in the semicolon-free world. Most likely you wouldn't be getting in trouble in the first place since most of the examples had me thinking "why would I ever write code like this?". Besides, I think that recommendation maybe came from a time when the ASI was unreliable and linters were not common. My eslint is awesome at keeping me out of trouble.

For good reading, have a look at the linked articles at the bottom here http://eslint.org/docs/rules/semi.html


There are a few scenarios where you can get bitten by missing out semicolons.

However, this eslint rule should save you: http://eslint.org/docs/rules/no-unexpected-multiline


I stopped using semicolons a year ago, have not had a single error because of it.




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

Search: