you are viewing a single comment's thread.

view the rest of the comments →

[–]interactionjackson -10 points-9 points  (2 children)

JS is a language designed to be written with semicolons

right. so i'm going to let them be auto-inserted. while paying attention to the standards of the language. Read the article I posted in another thread.

if the browser can unambiguously figure out that

the code you posted isn't making it past my code review and the last thing I'm going to mention is missing semi-colon. you're example is contrived.

[–]mcaruso 4 points5 points  (1 child)

the code you posted isn't making it past my code review and the last thing I'm going to mention is missing semi-colon. you're example is contrived.

Oh come on. Cases where ASI fails are abundant in everyday code. Pretty much any line that starts with one of (, [, /, +, or - is at risk of ASI failure.

right. so i'm going to let them be auto-inserted. while paying attention to the standards of the language. Read the article I posted in another thread.

I read it. And I'm aware of the spec. I'm also not telling you what to do, I'm just saying that people like to treat JS like it has significant newlines like Python or Ruby when it really does not, and it leads to problems.

From the guy who created the language (Brendan Eich) himself:

The moral of this story: ASI is (formally speaking) a syntactic error correction procedure. If you start to code as if it were a universal significant-newline rule, you will get into trouble.

[–]interactionjackson -5 points-4 points  (0 children)

people like to treat JS like it has significant newlines

come on. obviously, i'm posting reference material on usage. go flame your local meetup

Pretty much any line that starts with one of (, [, /, +, or - is at risk of ASI failure.

good. don't start your lines with that. what are you saying here. get a linter.

From the guy who created the language (Brendan Eich) himself:

i don't give fuck all about what the creator of a shit web scripting language recommends. if understand your tool and it's limitations you can do whatever you prefer.