seanh

A Coffee Break with CoffeeScript

Yesterday we were having a little water-cooler conversation admiring CoffeeScript.

I had a look at this a while ago, when I was first investigating JavaScript. I remember liking it then, and looking at the syntax again, I think it’s pretty cool.

Today, I Googled around to check out some criticism from people that had actually used it, and I found some interesting links, including the “A Case Against Using CoffeeScript

There were a number of points, which really just point out that you can write bad code in any language. That’s not really a strike against CoffeeScript. Just don’t expect it to be idiot proof.

The real grind is debugging, since you write in CoffeeScript and debug in JavaScript. The workflow is complicated, and reading generated code is way worse than hand-written code.

Of the big advantages, CoffeeScript saves you from some of the big syntax gotchas in JavaScript (e.g. accidentally creating a global variable, and automatic semicolon insertion).  But there are other alternatives such as using a tool like JSLint.

If CS were run directly by a VM in the browser with debugger support…well then we’d have something. Apparently coffeescript is influencing the future of JavasScript.

For now, what you gain in readability you lose in debuggability. Make fewer bugs that take longer to debug, or make more bugs that are easier to debug, where’s the break-even point?

For now, I’ll continue with JavaScript and read and write carefully, with help from JSLint.

But don’t take my opinion, there’s a great debate on it here: http://net.tutsplus.com/articles/interviews/should-you-learn-coffeescript/

The skinny: Definitely worth learning, maybe not worth using except for simpler one person projects.

 

 

Share

Tags: ,

Leave a Reply