DAVE'S LIFE ON HOLD

Coffeescript Good and Bad

The past two weeks I have been programming in Coffeescript almost exclusively. So far I've build a web app, a trio of daemons, and a full widget framework w/ pub/sub hub. I've been through about 1k loc of Coffeescript now and have a fairly good handle on it's strengths and it's weaknesses. Once you've built a full suite of applications in a language using every feature there of, you really don't have any excuse for not forming an opinion.

The good:


The bad:
Most of what is missing from the language isn't terribly obvious to the average javascripter. Things like auto return are annoying as hell if you are accustomed to chaining your functions. Having a function default to 'return this' is much more handy based on a quick tally of my functions. Implicit return which makes me add @ at the end of 90% of my functions is annoying. Another sin of omission is the persistence of assignment. If you are writing proper OO code, a method should be used to communicate with an object. Under no circumstances should you directly manipulate the property of an object! The common use for :: is in direct opposition to this, and should be considered bad form, especially since modifying the prototype affects all objects.

The fact that Coffeescript goes to such lengths to make classical inheritance sort of work, but fails to observe the idea of private state is to say the least annoying. More to the point, there are things Coffeescript does to create local variable scope which is defeated by still so heavily relying upon property manipulation.

This is not to say Coffeescript is a miserable programming environment, more that it suffers too much from an intellectual heritage that JavaScript was originally designed to get the fuck away from.