Wednesday, June 5, 2013

First I want to scold myself, I should spend at least an hour to check out Coffeescript. I have been skipping articles regarding Coffeescript in NetTuts and missed ManilaJS session last few months ago where the speaker is the maker of Backbone.js and Coffeescript, the Jeremy Ashkenas.

After a week now, I'm happy to see myself improving a lot on Javascript with the help of Coffeescript. It is time consuming to describe each benefits of Coffeescript because this is so awesome in so many ways.

If ever you decided to spend at least 30 mins of your time with Coffeescript then it's a good choice.

Everything start in Coffeescript Official website

Visit the site! There's a console for you to try Coffeescript on your browser.

Semi-colons will miss our gentle touch

If your a Ruby person then you might find Javascript a bit tedious on adding semi colons on every command or line you made. But that's okay, I'm a PHP developer and I survived it.

In Coffeescript, the semi-colon button will miss our touch since most of the convention doesn't require it.

Fuck Global variables!

Messing up the global variables in Javascript is a pain in the ass and it will be real pain the ass for maintaining your code base. But don't worry we will still access or write global but it will be much safer and easier on Coffeescript.

A better OOP 

I'm not saying Javascript is not good language for OOP but with Coffeescript it will give us more understandable way of creating Class and instantiating it.

class Animal

The code above will create an class name Animal which can also be extended on this approach

class Dog extends Animal

I know this is a very short take on how awesome Coffeescript is but this pieces change how I wrote code on Javascript. On my experience, Javascript has a big chance of getting a spaghetti code if not careful watched but having a more readable code your colleague can easily dive in to your chocolate mud playground.

So try it!


Post a Comment