3 ms·
"It's actually quite difficult and artificial to find cases where (especially with "use strict") semicolons confer any benefit at all," Hence these are the cas
by raverbashing 13y ago
"It's actually quite difficult and artificial to find cases where (especially with "use strict") semicolons confer any benefit at all,"
Hence these are the cases where more time and resources will be wasted because of it.
"I certainly see far more bugs caused by an improperly inserted semicolon"
What would be an example of this? Because I've seen exactly zero bugs of this type (not counting typos, of course)
- Tloewald 13y agovar a = 17, b = 13; c = 5; (usually this will be across multiple lines) ...just overwrote c in a different scope. This kind of bug is common, idiomatic, baffling, and actually more likely among coders subscribing to javascript "best practices".
- raverbashing 13y agouse strict? jshint / jslint your code? This doesn't justify playing a guessing game and skipping semicolons just because you think you know all the rules about not using them.
- Tloewald 13y agojslint won't stop it if there's a variable (c in this case) in the outer scope -- it's perfectly fine code as far as jslint is concerned. And jslint encourages that declaration style (actually encourages is too weak a word).