24Aug

Coffeescript and Haskell have made me a better Javascript programmer…

Posted by Elf Sternberg as Uncategorized

Over at float:left, Andy Appleton wrote that Backbone Has Made Him A Better Programmer, and while I agree with much of what he said, I have to look back and say that no, it isn’t Backbone that’s worked for me– it’s Coffeescript and Haskell.

Coffeescript conquers one of the major source of pain in Javascript programming: objects and scoping.  Between it’s exceptionally easy class declaration mechanism, it’s simplified mixin scheme, and it’s always-on “this” binding, Coffeescript has completely eliminated an entire class of very common Javascript errors.

At the same time, Haskell has taught me to look hard at what my program is doing, and inquire whether or not what I’m doing is interactive or functional– and if it’s functional, write it as functionally as Javascript allows.  And that’s significantly functional, especially with Coffeescript.  Yes, under the covers Coffeescript turns into some mighty procedural Javascript, and there are some overzealous storage issues that make Coffeescript tricky for HTML5 game development (always check that your list doesn’t return a value– garbage collection pauses are a game killer).  But while Backbone does teach the “one object that does one thing well” idiom, Coffeescript and Haskell elevate the “one object” and “do it well” parts of the equation to first-class thinking.

2 Responses to Coffeescript and Haskell have made me a better Javascript programmer…

Andy Appleton

August 31st, 2012 at 2:47 am

Most of my time using Backbone has also been with CoffeeScript and I would agree that the `class` construct has probably got as much to do with my new found object-orientedness (totally a word) as Backbone.

Elf Sternberg

September 3rd, 2012 at 2:16 pm

Yeah, but I’d say Coffeescript and Underscore together have totally contributed to my newfound functionalness (also totally a word).

Comment Form

Recent Comments