|
|
|
|
|
by gavinlynch
5175 days ago
|
|
I wonder where the blow-back is generated from. Personally, and only anecdotal of course, I feel that I have seen a far greater amount of articles extolling the virtues of CoffeeScript than I have seen condemning it. To be honest, that is the only primary source of whatever trace of resentment I feel towards CoffeeScript: I'm just almost bored of hearing about it. (tongue in cheek) I don't use CoffeeScript, because Javascript suits me just fine. But I also don't know many developers that slam it or recall an abundance of anti-CoffeeScript articles... For whatever it's worth (shrugs) |
|
There are many reasons not to use Coffeescript.
Some may claim that 'coffeescript is javascript', it really is not. They say it with a straight face too. People that say this don't really understand the difference between DOM and Javascript, and it is very telling. Just because you can access DOM methods and properties using compiled coffeescript does not mean that the coffeescript syntax IS javascript, and nothing could be further from the truth. DOM is DOM. Javascript is Javascript. Coffeescript is Coffeescript. Confusing them just makes someone look like they don't know what they are talking about.
Anyway, javascript has been the only language used to code front-end websites for quite some time (thankfully vbscript in IE is not used any more) and as a result it has become very well know, widely written about, and quite a lot of code has been written in it. There is a wealth of experience and all the 'gotchas' are well documented and there aren't really that many of them if you don't count anything to do with the DOM. Coffeescript introduces its own gotchas. While it may fix/avoid a few of javascript's gotchas, it introduces its own. And worse, there are new releases of coffeescript that break compatability, so much that the latest version of coffeescript now adds a comment at the top of any generated code with the revision of coffeescript used to create the "transpiled" code. If you think changing the rules of the language regularly is a good way to develop software, then we don't have anything further to talk about.
There are limitations to coffeescript that make it difficult to work with. You can't have the same variable name used twice in the same source file. The var command is ambiguous, and coffeescript's syntax is generally more ambiguous than javascript leading to programmer error. It is more difficult to read coffeescript because of ambiguity that you don't get with C style syntax. Javascript uses clear delimiters { } for where things begin and end, coffeescript does not and this means 'less typing' in coffeescript, but at the cost of readability. Some say coffeescript is easier to read, more power to them. Hopefully I'll never have to read their code.