3 ms·
Quite honestly the premise is rubbish. "CoffeeScript isn't a language worth learning because it isn't a language. It doesn't make you think about programming i
by thackerhacker 15y ago
Quite honestly the premise is rubbish.
"CoffeeScript isn't a language worth learning because it isn't a language. It doesn't make you think about programming in a new way"
How is that a definition of a language? It compiles down to another language sure - but what doesn't?
- raganwald 15y agoIn spoken languages, there is a difference between a language, a dialect, and a specialized vocabulary. My premise is that CoffeeScript is a jargon of JavaScript. Maybe you could say it’s a dialect of JavaScript. But my premise is that notation alone does not make it a distinct language.
- swaits 15y agoDo you think C is a dialect of Assembly?
- raganwald 15y agoI can’t speak to whatever C looks like today, but when I first learned it, absolutely positively C was a kind of portable dialect of assembly for an idealized CPU architecture. For example, the (in)famous equivalence between 10[p] and p[10] point to C being a kind of translator rather than an entirely new way to think about programs.
- gcp 15y agoInteresting question. After some consideration, I think it depends on whether we are using an optimizing compiler(!) or not.
- robbrown451 15y agoI'm curious if your opinion on this would change if they made it so the browser could run Coffescript natively. Personally, I think the fact that it compiles to an intermediate language to be irrelevant to whether Coffeescript should be considered a language. I consider it a different language if for no other reason than, if a programmer familiar only with Javascript looked at code written in Coffeescript, they would not understand it at all. And it can't be converted to Javascript without either considerable hand work, or via an automated tool.
- raganwald 15y agoIf this “running natively in the browser” did not involve 100% cross-compatibility with existing JavaScript code, you might be moving up from jargon to a dialect. But as long as the underlying model is the same, and as long as it’s a leaky abstraction, I don’t think of it as a separate language. For example, if it were to be a separate language I would look for its OOP stuff to be implemented in the “engine” and not to be strongly related to the JavaScript prototype mechanism.
- podperson 15y agoSurely it's much more like a grammar than a jargon, since the content essentially stays the same (symbol names, values, etc.) but the arrangements change. In general, langages don't tend to have multiple grammars (although spoke languages tend to be looser than written), and perhaps the unnaturalness of having a second grammar might undermine your position.
- gcp 15y agoThe intrinsic quirks and behavior of CoffeeScript and JavaScript are the same. You cannot think of CoffeeScript as a kind of Python. It's a better (but with caveats) syntax for JavaScript. There's a 1-1 mapping of CoffeeScript syntax to JavaScript syntax. This is really useful when you are debugging. But it cannot introduce much useful new behavior. That's why I'd agree its more appropriate to see CoffeeScript as a new syntax for JavaScript, than as a new programming language.