Coffeescript, Jasmine and Katas
Hey-O!
CoffeeScript is nice. It provides syntactic
sugar and adds tremendous functionality to the web developers
tool-chest. Those who appreciate terse, yet readable and well formatted
code; CoffeeScript will seem like a manna from heaven. I find that I am
already looking at my JavaScript and refactoring it in my head to
CoffeeScript.
On long road trips I generally have a few hours to kill while the rest
of the family is asleep. I generally take this time to fire up some
podcasts and/or tutorials and to learn as I drive. I actually look
forward to this time as I can almost totally focus on the content.
This trip I decided to load my Galaxy Nexus with a metric ton of
CoffeeScript screen casts (just audio) and podcasts. My intention was to
get the basics out of the way and I accomplished that objective.
Since I've returned home, I have decided to stick with CoffeeScript and
add a few more. I have decided that my code needs to tested more
throughly. CoffeeScript has made testing a complete breeze.
I've also become a believer in dedicated, deliberate
practice.
One can constantly reuse the same patterns and never really push
themselves to get better. However, those who deliberately practice
techniques and patterns they are not comfortable with generally begin to
excel faster than those who just put in the hours haphazardly.
I used this code kata with
CoffeeScript and Jasmine.
Click the post image to see the passing tests!
Here is my solution:
The Spec's in CoffeeScript
[gist id=2014544]
The implementation in CoffeeScript:
[gist id=2014548]
Paste the CoffeeScript here to see what it
looks like in JavaScript.