4 ms·
Because all you see it as is an argument about syntax. It's actually an argument between the old guard and the up-and-coming hotshots. Nobody really cares one
by dclowd9901 15y ago
Because all you see it as is an argument about syntax. It's actually an argument between the old guard and the up-and-coming hotshots.
Nobody really cares one way or another, and while it would take Twitter more time to append changes to their code than it would Crockford, my guess is the trouble for either would be negligible.
That said, this is very obviously a pride war between those who stick to convention and those who undermine it. The question isn't "should we use semicolons", it's "who is going to start dictating the direction Javascript goes from here on out?"
Clearly, both of these individuals want that spot, but if there's anything I've learned in my short time of coding, convention always wins out.
- jpk 15y agoThat's a pretty dramatized way of framing it, don't you think? I think the take-away is as simple as this: JavaScript is a dumpster-fire, and we should probably fix it so we can avoid more of this noise. Framing it as a soap opera conflict instead of a teachable moment makes it more productivity-draining than it already is.
- dclowd9901 15y agoI'm only explaining what makes sense. I know, personally, I'm not going to change how I'm writing my code because of what two influential Javascript developers bitched about on a Github ticket, and I'm pretty sure I'm not alone in that sentiment. I'm merely explaining why it's drawing so much attention, and what nerves this debate seems to be touching, because as a technical debate it is insanely boring. But that's clearly why it's not strictly a technical debate.
- batista 15y ago>That said, this is very obviously a pride war between those who stick to convention and those who undermine it. I'd frame it as "a pride war between people wanting a sane codebase not based on fragile parser edge cases --include two that know the language inside out--, and the developer of some minor js code that thinks he's too clever for all that". That's no "undermining convention", that's juvenile bs. I know who I'd rather have on my team.
- blasdel 15y agoIt wasn't a "fragile edge case", it worked just fine with no ambiguity in every javascript implementation. The problem is that jsmin is a naive pile of textual replacements (though not quite as abysmal as John Gruber's markdown.pl) instead of being a javascript implementation — something that actually parses javascript into an AST and compiles it to minified javascript. He left out cases for several unary operators so it broke perfectly valid code. After bitching at them he came to his senses and fixed it: https://github.com/douglascrockford/JSMin/commit/5ca277ea452beae1c25db3bc0ef5c81309a3daf4 https://github.com/douglascrockford/JSMin/commit/5ca277ea452... Unless for some reason you need your minifier to be trivial enough to be portable with no dependencies, you should really be using something along the lines of google's Closure Compiler, which produces far better output and even has stuff like tests!
- batista 15y ago>It wasn't a "fragile edge case", it worked just fine with no ambiguity in every javascript implementation. Yes, it worked according to how the parser was designed. But it depended on a frowned-upon parser feature (AST), that can lead to ambiguous or faulty results in similar cases, and for no good reason. When the creator of the language and its biggest guru disagree with your code style, well, there's no much room for an argument, even if all known implementations work fine with your code. He also did an idiotic ?: operator abuse instead of a clear "if" in the same exact line. He probably likes silly "succinct code" tricks, which even C people wouldn't touch with a large pole...
- tptacek 15y agoIt is just an argument about syntax.
- stephencanon 15y ago"Hotshots" have better things to do with their time than argue this nonsense.
- mquander 15y agoThat's even less interesting. I give 2/10 of a crap about what the best way is for me to avoid missing-semicolon errors in Javascript, but I give 0/10 of a crap about who wins an ego battle between Crockford and some other dudes. Why on God's green earth is that on the front page of anywhere?