After one year working with Titanium, I found their decision of using javascript has bring good thing and also bring some bad side effects. The javascript language is easy to pick up but lacking of object oriented support. I am aware of the prototype object method, however the code looks ‘unnatural’, compared to other scripting language such as python and ruby.

We’ve developed two small iphone projects so far but the code base are difficult to maintain and understand. I decided to look for way to solve this problem. This is when I found Coffescript project.
Coffeescript develop as a layer that make javascript to look like object oriented language. It influenced by what is good practice from both Python and Ruby language. It then compiled the coffescript code into regular javascript. It does this so you don’t need to do the dirty works of understanding javascript. The code that come out is so much easy to understand and maintain.
So before we got started, go ahead and download and install Coffeescript into your machine. Make sure you got the latest titanium and titanium developer installed as well.

You will need to first install node.js
git clone git://github.com/joyent/node.git
cd node
./configure
make
sudo make install
Once you’ve installed node.js, then next thing is to install npm. NPM is node.js package manager. It is similar to redhat package manager (rpm). It will allow you to easily install any node.js package, in this case coffeescript.

curl http://npmjs.org/install.sh | sudo sh
Once node.js and npm installed, coffeescript will be installed easily by
npm install coffee-script
You are now ready to get started. You can get started to learn coffeescript by following the presentation below.