News for hackers. Stuff that matters.
Re:The infernal semicolon (2012) by IshKebab on Thursday March 05, 2015 @12:41PM (#9152354)
The problem is that the rules for remembering where they are needed are hard to remember and error-prone.
Re:The infernal semicolon (2012) by BrendanEich on Thursday March 05, 2015 @12:47PM (#9152412)
See http://inimino.org/~inimino/blog/javascript_semicolons, hope it helps. The minimal semicolon style has only a few rules and many people find it easier to use and remember. I've used it but my C hacker habits go against it. It's a fine style.

/be

Re:The infernal semicolon (2012) by aikah on Thursday March 05, 2015 @12:57PM (#9152520)
Wow neat,yeah, js devs are going to call anyone out that doesnt use semicolons.

Question : If you ever wanted 1 breaking change in the language, and somehow it would be possible (I know it wouldn't) what feature would you change ? Again just 1 feature.

Re:The infernal semicolon (2012) by BrendanEich on Thursday March 05, 2015 @01:03PM (#9152555)
I would undo the implicit conversion madness around == and !=.
Re:The infernal semicolon (2012) by cozuya on Thursday March 05, 2015 @02:55PM (#9153388)
Is that really a big concern today where == is heavily frowned on by just about everyone due to the above and its slowness?
Re:The infernal semicolon (2012) by BrendanEich on Thursday March 05, 2015 @06:49PM (#9154718)
== is not slow when types of operands (in typeof sense) match -- then it's equivalent to ===.

You'll find a lot of == out there, or would if only Google code search were still up.

Hey, I got to answer with the one thing I'd change. There are more than a few, and I had to pick. Losing the equivalence relation I had in the first ten days (apart from NaN != NaN of course) was my pick.

Re:The infernal semicolon (2012) by xtrumanx on Thursday March 05, 2015 @01:08PM (#9152603)
I treat the issue like the issue of remembering the operator precedence rules or just using some extra parenthesis.

Although I feel remembering where semicolons are needed is simple I still use them anyway for personal preference.

Re:The infernal semicolon (2012) by insin on Friday March 06, 2015 @06:03PM (#9160167)
I haven't used semicolons in JavaScript in places they're not necessary for years now - the only rule that's mattered in practice [1] is lines starting with [ or (.

[1] This is a white lie - there is one additional vital ASI rule, but you already know it - don't put a linebreak after a return statement.

Re:The infernal semicolon (2012) by serve_yay on Thursday March 05, 2015 @12:45PM (#9152383)
Sure, but in practical terms I feel like this never comes up. I just never have to deal with it and I write JS all day.
Re:The infernal semicolon (2012) by esolyt on Thursday March 05, 2015 @01:40PM (#9152867)
Not harder than inserting a semicolon after every single line.