• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Is it worth it to learn CoffeeScript?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
I like JavasScript. I don't feel that it's wordy. I enjoy the semicolons and the braces and all of that stuff. I feel that it visually separates things way better than just the indentations and blank spaces of CS.

And of course, every single piece of instruction and documentation and sample code for anything is written only in JS, not CS.

For shits and giggles I'm converting my current Meteor app to CS. Been at it for two days and I'm getting some errors but even when I don't get errors I just don't like the look and feel of CS...

Arguments for and against CS? I think I write pretty readable and clean JS as it is...
 
It removes some boilerplate and adds better functional programming support for things like map and filter in addition to its syntax changes along with some other features.

Personally I think the code ends up more readable and higher abstraction in loops especially and so it ends up a somewhat better langauge in a lot regards. However by compiling down into javascript what it also adds is a factor of complexity where you are writing in Coffeescript and debugging in JavaScript. You have to know pretty well what Javascript the CS is going to compile down to in some cases as well, especially some of the oddities around scoping.

So the end result is that in order to program in CS you need to know JS already and reasonably well. CS can improve the quality of the code a bit, especially FP, but at the same time it adds some debug complexity and needs a build which works for some websites and not so much for others. I have used it on a couple of projects in the last year, its OK I don't like or dislike it anymore than I like or dislike JS.
 
I agree. JS is already very readable and curly braces are something I have been doing since learning C in college. I don't need to get rid of them.
Frameworks like jQuery simplify things even further. I don't see the major benefit of adding additional dependencies to your project when you still need to know javascript for debugging purposes.

In the same vain as Coffeescript I have been a little more on the fence about SASS. It adds some great features I wish CSS had from the beginning, but am hesitant to add another dependency for the sake of a problem I can solve in most cases with search and replace.
 
It removes some boilerplate and adds better functional programming support for things like map and filter in addition to its syntax changes along with some other features.

Personally I think the code ends up more readable and higher abstraction in loops especially and so it ends up a somewhat better langauge in a lot regards. However by compiling down into javascript what it also adds is a factor of complexity where you are writing in Coffeescript and debugging in JavaScript. You have to know pretty well what Javascript the CS is going to compile down to in some cases as well, especially some of the oddities around scoping.

So the end result is that in order to program in CS you need to know JS already and reasonably well. CS can improve the quality of the code a bit, especially FP, but at the same time it adds some debug complexity and needs a build which works for some websites and not so much for others. I have used it on a couple of projects in the last year, its OK I don't like or dislike it anymore than I like or dislike JS.
Hmmm... so to debug CS you *have* to debug the JS code itself anyway? Even with source maps?

I have a hard time debugging what is essentially empty space...

The coding bootcamp for beginners (ie. no prior coding experience) that I took and still hang around at starts everyone out in CS, which is something that I strongly disagree with simply from a "newbie learning coding" perspective.
 
Its got sourcemaps, but like with any language ultimately you are going to be using javascript at some point. I had this one issue using AngularJS and CS where once I looked at the Javascript it become clear what I was doing didn't work in AngularJS, so at that point I was able to fix it. Its not really debug stepping that is so much the issue as just understanding how the two languages differ and translates. There is no way to program in CS without knowing JS, none whatsoever. It'll bite you within a day or two, you will need to read the produced JS at some point of that I am certain. I spent about 4 weeks programming in it and without the JS knowledge I would have seriously struggled, I ended up dipping into the JS code initially quite a lot. As I learnt the oddities of the translation process then I used it less, but if your guide on how to do something in is JS and your writing in CS...yeah that is going to get ugly fast. Some of the frameworks need some odd lines of code compared to JS tutorial. Just be aware of it, it happens in all source code translation based languages, you always need to know the target language or you'll have problems.
 
Last edited:
At the end of the day, you still have to debug JavaScript. Having to debug something different than the source code is a deal killer for me.
 
I also don't want to be too negative about Coffeescript either. It has all the usual problems of a translated language but at the same time some of the advancements do make certain things a lot easier than JS. The Functional programming improvements do help with readability and are quicker to write and closer to how you should be thinking about the problems. But its not with its caveats.
 
I also don't want to be too negative about Coffeescript either. It has all the usual problems of a translated language but at the same time some of the advancements do make certain things a lot easier than JS. The Functional programming improvements do help with readability and are quicker to write and closer to how you should be thinking about the problems. But its not with its caveats.

I'm personally a bigger fan of what languages like Dart and Typescript bring to the table. Google has particularly done a good job with Dart IMO (I'm using it for a side project). I pretty much never dive into the compiled javascript.
 
Back
Top