3 ms·
From somebody who used CoffeeScript extensively: I don't think it's a great choice for bigger production projects. The less "noisy" syntax has some very unfortu
by jkrems 7y ago
From somebody who used CoffeeScript extensively: I don't think it's a great choice for bigger production projects. The less "noisy" syntax has some very unfortunate consequences. For one, it has zero error correction. Almost any random sequence of characters is a valid program so any minor mistake looks at first like it's working and may even pass some tests but looking at the compiled code makes it suddenly obvious that the code is doing something utterly unexpected. Examples include:
* Minor spacing mistakes subtly moving code between blocks.
* A variable in a nested scope accidentally reusing a name from another scope and merging the variables.
* Implicit return generating huge collections that are never used because a function happened to end in a loop.
* Random breakages because the value of the last statement in a function sometimes affects the callee even though the author didn't mean to return a meaningful value.
* People not setting strict mode because "it's not needed with CoffeeScript" but then introduce bugs where they try to write to readonly properties which silently "succeeds" (does nothing) in sloppy mode.
CoffeeScript looks nice and readable but in practice it's almost impossible to decipher what the code actually does.
- haolez 7y agoMost of these issues could be said about Python as well, but the environment that you describe is of a very poor code quality culture. This can happen in any language. I'm not saying we should use CoffeeScript in 2019, but that the criticisms seem vague.
- BossingAround 7y agoI'd say that a lot of the same arguments are valid for Python or yaml. Why both of these are very widely used while coffeescript slowly died is beyond me. I, for one, really dislike any language that uses syntactic whitespaces.
- riadd 7y agoThe implicit collection problem can be prevented by making sure that you put explicit return statements at function ends. This goes contrary to the dense syntax argument but at least there is a workaround for performance critical code.