News for hackers. Stuff that matters.
Re:Of parser-fetishists and semi-colons by tptacek on Monday April 16, 2012 @12:36PM (#3848079)
Anyone else think this is by far the most boring technical debate ever to hit HN?
Re:Of parser-fetishists and semi-colons by dclowd9901 on Monday April 16, 2012 @02:51PM (#3848731)
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.

Re:Of parser-fetishists and semi-colons by jpk on Monday April 16, 2012 @04:45PM (#3849336)
That'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.
Re:Of parser-fetishists and semi-colons by dclowd9901 on Monday April 16, 2012 @05:12PM (#3849464)
I'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.

Re:Of parser-fetishists and semi-colons by tptacek on Monday April 16, 2012 @09:14PM (#3850459)
It is just an argument about syntax.
Re:Of parser-fetishists and semi-colons by mquander on Monday April 16, 2012 @11:18PM (#3850864)
That'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?
Re:Of parser-fetishists and semi-colons by stephencanon on Monday April 16, 2012 @10:09PM (#3850648)
"Hotshots" have better things to do with their time than argue this nonsense.
Re:Of parser-fetishists and semi-colons by batista on Monday April 16, 2012 @04:57PM (#3849395)
>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.

Re:Of parser-fetishists and semi-colons by blasdel on Tuesday April 17, 2012 @02:18AM (#3851431)
It 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/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!

Re:Of parser-fetishists and semi-colons by batista on Tuesday April 17, 2012 @10:06AM (#3852594)
>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...

Re:Of parser-fetishists and semi-colons by jamesu on Monday April 16, 2012 @01:10PM (#3848246)
To be quite honest yes.

I started programming and hacking because i wanted to make something cool and interesting which others would appreciate, not to bicker about something as silly as semicolons. If i wanted to do that, i'd work in retail. When an argument over something so trivial gets to this level, i cannot help but be bored by it.

Re:Of parser-fetishists and semi-colons by brown9-2 on Monday April 16, 2012 @01:53PM (#3848485)
I think it's so boring because it's a one-sided debate.

One side chooses a style that they find aesthetically-pleasing even if it causes issues for some small subset of potential users.

The other side is flabbergasted that someone would be so reckless and argues for the sensible, safe option, which requires simply terminating your lines of code with an extra character, making those few issues for a small subset of potential users vanish instantly.

Re:Of parser-fetishists and semi-colons by tptacek on Monday April 16, 2012 @01:55PM (#3848493)
Oh for fuck's sake.
Re:Of parser-fetishists and semi-colons by chris_wot on Monday April 16, 2012 @07:24PM (#3850049)
I understand the frustration with this comment, but the clincher for me on the whole anti semi-colon crowd was at this article:

http://www.wordsbyf.at/2011/10/31/i-dont-write-javascript/

He says he doesn't use semicolons, except that it caused issues for those who concatenation scripts so he adds a semicolon to the end of the js file. But, lo! This causes issues for those who use the following pattern:

  (function() {
     // Le code
  })()
This has the potential to cause syntax errors when you execute two anonymous functions after each other. Instead of adding a semi-colon to the end, he "works around" the issue by abusing JavaScript like so:

  !function() {
    // Le code
  }()
For fucks sake indeed!
Re:Of parser-fetishists and semi-colons by tptacek on Tuesday April 17, 2012 @12:19AM (#3851083)

  (function() {
     // Le code
  })()

  !function() {
    // Le code
  }()
YOU'RE RIGHT. I'M HORRIFIED.
Re:Of parser-fetishists and semi-colons by davesims on Monday April 16, 2012 @01:31PM (#3848376)
Yep. Sayre's law has kicked in with a vengeance here.

"In any dispute the intensity of feeling is inversely proportional to the value of the issues at stake."

http://en.wikipedia.org/wiki/Sayre%27s_law

Re:Of parser-fetishists and semi-colons by tlogan on Monday April 16, 2012 @01:32PM (#3848384)
Actually, my understanding that there is nothing technical about this debate: the debate is about writing maintainable, supportable, and portable code versus "cool" code. But I also agree this is "by far the most boring debate ever to hit HN" (without technical :).
Re:Of parser-fetishists and semi-colons by WiseWeasel on Monday April 16, 2012 @01:39PM (#3848419)
I think this piece is a great place to end it, as it builds a solid pragmatic case.

It was interesting for me to learn about the possibility of using that kind of '!' notation in JS, even if it's impenetrable to most other developers. Maybe I'll be able to parse some other hipster's code thanks to this.

Re:Of parser-fetishists and semi-colons by sophacles on Monday April 16, 2012 @12:51PM (#3848153)
Of the sustained debates, I feel it is tied with the "my nosql is better than yours" debate. Both of them seem to boil down to "understand your tools, your use case may not map to the thing someone else is advocating for their use case".
Re:Of parser-fetishists and semi-colons by tptacek on Monday April 16, 2012 @01:00PM (#3848198)
This is so, so, so much more boring than NoSQL. I agree that Riak vs. Mongo has gotten pretty boring. But this is semicolons. For f's sake.
Re:Of parser-fetishists and semi-colons by sophacles on Monday April 16, 2012 @01:25PM (#3848328)
I dunno... semi-colons have practical implications for everyone, but "my use case requires speed and persistence isn't an issue, therefore mongo is better" vs "i need persistence and didn't read the docs, who cares if it's a little slower - riak is better" gets pretty tiresome, particularly when my use case is "i need easy graph traversal, neo4j w/ gremlin is the wave of the future". :P

hahaha - I feel the best use of this thread is that we agree to spawn a series of blog posts debating the most boring debates to hit HN ever. Including sock-puppets to randomly drop surprise left turns like "no you are all wrong, here is why the ocaml vs haskell debate bores me" and "no, the real boredom is the long comment threads in the ongoing 'anarco-socialist' vs 'enlightened-libertarian' viewpoint wars"

:)

Re:Of parser-fetishists and semi-colons by dasil003 on Monday April 16, 2012 @04:03PM (#3849087)
Of course it's more boring than NoSQL debates, but it's also potentially so much more important. The reason people care is because you have two great projects which they might want to use for many reasons, but which are fundamentally incompatible because of a semicolon. It's not the philosophical divides between database technology where you have many subtleties to analyze and choose between, instead it's just a fucking semicolon forcing you take sides between two orthogonal projects which you might have good reason to use jointly.
Re:Of parser-fetishists and semi-colons by coderdude on Monday April 16, 2012 @01:12PM (#3848258)
It could be so much worse. At least they're not going on about camelCase and Hungarian notation.
Re:Of parser-fetishists and semi-colons by davesims on Monday April 16, 2012 @01:21PM (#3848304)
Disagree. This is so much worse than that. At least with Hungarian notation (which thankfully died a well-deserved death), its advocates were arguing for a relatively well thought-out system of readability and tying member names to their types for quickly-identifiable scope and type referencing.

But, to suggest that simply removing semicolons constitutes some grand gesture towards readability, simplicity, or something as grandiose as a "minimalist aesthetic," is...beyond absurd.

It is Bike Shedding Qua Bike Shedding.

Re:Of parser-fetishists and semi-colons by Cushman on Monday April 16, 2012 @01:30PM (#3848372)
But you're... you're doing it. Look at yourself. You have a strong opinion about using semicolons.
Re:Of parser-fetishists and semi-colons by davesims on Monday April 16, 2012 @01:42PM (#3848431)
Oh Good God, it's true.

"We have met the enemy, and he is us."

http://ow.ly/ajyBJ

Re:Of parser-fetishists and semi-colons by burgerbrain on Tuesday April 17, 2012 @12:16AM (#3851075)
You seem to be pretty interested in being as bored as possible with this discussion.......
Re:Of parser-fetishists and semi-colons by gnuvince on Monday April 16, 2012 @01:05PM (#3848217)
Re:Of parser-fetishists and semi-colons by lifeformed on Monday April 16, 2012 @12:45PM (#3848133)
It seems more like a social interaction issue than a technical one.
Re:Of parser-fetishists and semi-colons by gruseom on Monday April 16, 2012 @12:57PM (#3848181)
Bingo. I'm sure the same was true of angels dancing on the head of a pin.

Edit: the point is that sometimes arguments seem stupid because we don't always say (or even know) what we really care about.

Re:Of parser-fetishists and semi-colons by arethuza on Monday April 16, 2012 @01:19PM (#3848296)
If there had been software development a thousand years ago we'd be burning people for using (or not using) tabs/semicolons/emacs etc.
Re:Of parser-fetishists and semi-colons by slantyyz on Monday April 16, 2012 @12:44PM (#3848129)
Agreed!

It amazes me how much time people have spent arguing over this.

When I see an open source library that's not coded in the way I like, I either customize it to my liking or look for alternatives.

The only time I would really care about someone's programming style is when I work with them, otherwise live and let live.

Re:Of parser-fetishists and semi-colons by fusiongyro on Monday April 16, 2012 @05:09PM (#3849451)
It would be that way, but for the fact that this style breaks other tooling.
Re:Of parser-fetishists and semi-colons by ScottBurson on Monday April 16, 2012 @04:08PM (#3849114)
It interests me as yet another example of why DWIM in programming languages is a bad idea.

Maybe the next time a language designer contemplates including such a feature as ASI, he/she will remember this furore and reconsider.

Re:Of parser-fetishists and semi-colons by Cushman on Monday April 16, 2012 @01:27PM (#3848357)
God, yes. For that matter, it's not even a technical debate; it's all purely stylistic.

It boggles the mind that so many otherwise intelligent people have decided to take the time to form an opinion about semicolons.

Re:Of parser-fetishists and semi-colons by Natsu on Monday April 16, 2012 @04:52PM (#3849369)
Maybe. But I barely spent any time reading all the arguments and more time reading through and learning about the syntax of JavaScript, so it was probably more interesting for me than most people simply because I tuned out most of the boring bits. Also, I learned that Closure linter's fixjsstyle can add semicolons for you, which is nice to know.

But that's what I always do: scan for the interesting bits or move on.