32 ms·
I wholeheartedly agree. While Coffeescript to some is a must-have in every project they work on, it comes with a higher learning curve than Javascript itself. I
by DigitalSea 12y ago
I wholeheartedly agree. While Coffeescript to some is a must-have in every project they work on, it comes with a higher learning curve than Javascript itself. I understand we as developers are always trying to find ways to do things faster, less typing and better productivity as well as eliminating error, but Coffeescript is not the silver bullet that many make it out to be.
I actually had a Coffeescript experience a couple of years back on quite a large project I was pulled into for about 6 months and it was the worse six months of my life. The syntax is confusing and did not seem to serve any purpose other than the lead developer had a beyond healthy infatuation with Ruby on Rails and a worrying hatred for conventional Javascript. It didn't help that developers who had not used Coffeescript before were being added to the team and every five minutes were asking questions about how to do something in it. Efficiency for the first few weeks was at an all time low because the lead developer thought using Coffeescript would give us an edge.
If anyone tries telling you that Coffeescript does not have caveats of its own, they are lying to you. Sure, it fixes some shortcomings and issues with scope and operators, but it also introduces some weird issues when it comes to scoping and definitions of functions. It is not the angelic syntactic sugar that it is made out to be, it's a lazy developers way of writing Javascript. With the recent feature freeze of ES6 adding in support for classes and other nice additions to Javascript, the need for Coffeescript is further lessened in my opinion.
I think the issues that Coffeescript aims to fix are easily fixed in conventional Javascript by using something like JSHint to prevent things loose equality operators and other pitfalls in Javascript. Save yourself some headaches, reduce the barrier of entry for future developers and just use conventional Javascript, heaven forbid having to write a curly brace or use the var keyword is not going to kill you.
- Bahamut 12y agoNot to mention, ES6 adds a lot of the more useful stuff from CoffeeScript without most of the problems. All too often I have seen developers using CoffeeScript run into the unfortunate implicit return and awful readibility of objects problem when trying to debug code - I often either point it out off the bat, or I use the CoffeeScript compiler to figure out what they had and what they intended. That is extra unneccessary overhead for developers.
- sanderjd 12y agoI'm curious what issues you've run into with implicit returns. I haven't traced a single problem to implicit returns in many years of using languages that have them.
- Bahamut 12y agoNot me so much as others - it's a very common problem I've seen when debugging other people's CoffeeScript code. CoffeeScript is a bit of a different situation than other languages since with other languages, it's the norm (i.e. Ruby) - however, with JavaScript, it is not something inherent in JS, so when people jump from JS to CoffeeScript, there is a disconnect.
- sanderjd 12y agoThanks for taking the time to respond, but I'm wondering what specific "common problem [you've] seen when debugging other people's CoffeeScript code", ie. what bug does implicit return commonly cause in their code?