Live data from Hacker News

Of parser-fetishists and semi-colons

christianheilmann.com

31–40 of 125 posts

Re: Of parser-fetishists and semi-colons

#31
I have grown extremely weary at the level of discourse that this whole situation has provoked - the linked post is one ad hominem after another! What is this supposed to accomplish? Hopefully I can get the people I'm criticizing to change their ways by making them feel really bad about themselves? By telling them they aren't visionaries, they are semi-colons, they are arrogant, sloppy, lazy? It's destructive, self-indulgent, and completely unnecessary.

Re: Of parser-fetishists and semi-colons

#32
post #3

I think the argument that we shouldn't rely on the parser for certain language features is a bit silly (including interpreting end-of-statements). The language is precisely what the parser says it is, and nothing more or less. JSMin is free to not do what the parser does of course, but that won't be Javascript.

Surely the language is precisely what the spec says it is? "The parser is the spec" is a nasty design smell, IMO.

Surely the environment is the spec.

If he wants his code to work with this particular minifier, he should include the semicolon, nothing more, nothing less.

Is a bit like trying to speak in official french. It might be correct according to the officials charged with protecting the french language, but you will sound extremely odd to most french people.

Re: Of parser-fetishists and semi-colons

#34
> The main issue with these parser-fetish arguments is that they assume that you write code for a parser – sometimes even a certain browser – and not for other developers.

That's an excellent and important point beyond the petty incident. You write code solely for humans, not for the compiler.

Re: Of parser-fetishists and semi-colons

#35
post #25
post #11

I've been shocked at the level of disrespect for language standards here. Yes: adding semicolons is probably good practice because it avoids the chance of stumbling over bugs like this. And yes: the ASI feature in Javascript is in hindsight a terrible mistake. That said: you go to war with the language you have, not the one you might want or wish to have. ECMAScript is ECMAScript. Arguing that your transformation too…

I think you missed the point. This is not really about whether semicolons are required or not. The point is that in order to ensure maintainability of code you should try to use language (and framework) in a way which ensures better maintainability, supportability, and portability of your code. Look, the statement like "a && b" is 100% valid in many languages but in order to increase maintainability, supportability,…

No no, I assure you that was the point I took away. And it seems you missed mine, which is that it's fine to make pronouncements like "don't use short circuit and as an infix if" for your own code. But flaming about them in public is rank pedantry. It's the kind of nonsense that the enterprise world has been dealing with for 20 years now: chasing the "maintainability rule of the week" is going to hurt you badly long term.

Learn to read and maintain the language you have, because you can't win this.

Re: Of parser-fetishists and semi-colons

#36
post #2

This whole debate seems like two folks stuck in their way blowing a whole thing out of proportion. How about Bootstrap adds the damn semi-colon and JSLint accepts that for the most part the lack of a semi-colon is working and "valid" JS add allows for the edge case. Now everyone gets to go home happy.

Bootstrap and JSMin have both since fixed their code.

http://news.ycombinator.com/item?id=3845267

Re: Of parser-fetishists and semi-colons

#37
post #17

This whole debacle is the epitome of what I call alpha-nerd behavior, and it's slowly killing my interest in software development.

It's actually quite easy to develop software while being only vaguely aware of and emotionally uninvested in these sorts of kerfuffles.

Well, in nearly every job I've had, there's at least one alpha nerd[1]. Worst of all is the alpha nerd boss (I intentionally avoid the word 'manager' here). I welcome advice on how to find working environments free of this sort of thing.

[1] - two or more is even worse: they're like male gerbils or betta fish, in that they fight all the time.

Re: Of parser-fetishists and semi-colons

#38
post #13

Anyone else think this is by far the most boring technical debate ever to hit HN?

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

#39
post #3

I think the argument that we shouldn't rely on the parser for certain language features is a bit silly (including interpreting end-of-statements). The language is precisely what the parser says it is, and nothing more or less. JSMin is free to not do what the parser does of course, but that won't be Javascript.

Surely the language is precisely what the spec says it is? "The parser is the spec" is a nasty design smell, IMO.

Yup- "computer science" is definitely going retrograde. It was recognized a long time ago that the "implementation is the spec" was a disaster for program semantics. And now we have "implementation is the spec" for something as easy and inessential as parsing. 1950s computer science labored under the misapprehension that parsing was hard (FORTRAN contributing greatly to this feeling). Then parsing was solved (while we don't always user machine generated parsers the ability to specify a grammar and see what features make parsing easy versus hard is a huge step forward). In fact this early victory over the formerly hard problem of parsing is one of the reasons people started anticipating higher and higher level languages and the complete automation of programing. But (as Brooks points out in "The Mythical Man Month") parsing was solved precisely because it was an inessential difficulty. Save your mental cycles for essential difficulties (semantics, evolution of state, remote machines, concurrency and actual domain problems).

Re: Of parser-fetishists and semi-colons

#40
post #30

Earlier quoted context omitted.

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".

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.

It could be so much worse. At least they're not going on about camelCase and Hungarian notation.
Post reply on HN