Hacker News new | ask | show | jobs
by EvilTerran 5173 days ago
Surely the language is precisely what the spec says it is?

"The parser is the spec" is a nasty design smell, IMO.

2 comments

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

I've heard that in Korea, there's one national standard exam for English that's always been graded incorrectly, so everyone learns the incorrect answer when studying for the test.