Fawk Status Quo by Leon Yeh

Text

Titanium and Coffeescript: Step 1 Getting Started

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.

Coffee Script Premiere

View comments
Posted on Monday, March 14 2011.

Fawk Status Quo by Leon Yeh Born into an entrepreneurial family, I have been heavily influenced by my father. He started as a street vendor selling pastry at a very young age using his old bicycle. He then later started many companies. Most of them failed. However, one company that was a success from the beginning. Using this humble start, he was able to create many other equally successful businesses. My father is always my source of inspiration.

I could have followed my father footsteps and joined the family business, but I wanted to create my own path. Yes, I am as stubborn as he is. Using the money that I had saved from my years working in a giant Aerospace company in US, I was able to build a successfully startup. In one year, our revenue was in seven digits. The future was bright and I felt that I could do no wrong.

Several years later, my startup hit many snags, and business slowed down dramatically in a very short period of the time. It was a rather humbling experience. Like Mike Tyson once said "Everyone has a plan, until they got punched in the face". The simple plan was just to survive long enough to last another round.

The good news is that as each round of punishment comes and goes, I am learning more and more. I am determine to get this thing right. Slowly things started to turn around. Not yet out of the woods, but definitely seeing the light at the end of the tunnel.

Recently I have started a new startup that focus South East Asia market problem. Instead of exporting out the western solution, we are focusing on using local help to come up with a solution that works best for them. I believe in a local solution for a local problem. This conviction has been a total game changer for me and people that I work with.

Most of the time, people already has solutions right in their grasp. They just need someone to listen to them and point it out. I intend to do just about that.
Ask me anything
Previous Next