Skip to main content
Enterprise Agile Planning icon with arrows

This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.

Last Updated Feb 17, 2013 — Enterprise Agile Planning expert

Just for Fun: Convert MetaMorformizr to CoffeeScript

Enterprise Agile Planning
Developing Custom VersionOne Apps 101 Series GuideLast time, in The VersionOne MetaMorformizr App // Using the VersionOne REST Meta and Localization APIs to GET Serious, we explored the VersionOne Meta and Localization APIs to make our User Story editor much more maintainable and flexible.Now, let's caffeinate it.If you've not yet used CoffeeScript, a language that compiles into JavaScript, you might like it. At least try it. I got introduced formally to it here at VersionOne, and have grown to love it.


Here's the JavaScript Gist of the MetaMorformizr App from last time: [gist id=4685990 file=gistfile4.js]

The easy way to caffeinated code!

Head on over to and try it out with some of your own code.

Blech, is this sh#t decaf?

Now, it may be the easiest way, but it didn't convert the MetaMorformizr correctly. Here's what it did: If you try this JSFiddle, you'll see it doesn't really work out for ya, but you also don't get any errors in the console. [gist id=4685990]

Fixing it manually

I had to manually rearrange some of the code. I'm not sure why. Maybe my original JavaScript could be written better? I am not really sure. Try it out in this live JSFiddle. [gist id=4685990]

Why I like CoffeeScript

Here's what comes to mind off the top of my head...

I prefer typing less, thinking more

I'm not of the opinion that "fingers on the keys" means "more productivity". Nonsense. What you're building a product that nobody wants, or that could get from open source, or  buy from less than you pay for it? Did your fingers on the keys really make you "productive"? So, given I can type this for handling some trivial, but Christmas Tree Callback prone jQuery deferred objects in a list: [gist id=4687639]25 lines of code, 918 charactersinstead of typing this: [gist id=4687639 file=gistfile2.js]34 lines of code, 1128 charactersThen, I am happier. And, I feel more productive in reality, not by an arbitrary "fingers on the keys" or "lines of code generated" kind of way.

Less cognitive strain

It's related to above, but dealing with the endless chain of }) and }) and somewhere, finally a });, is simply not cool. Been there since 1996. Done that. Done with it. Thanks. And, the same goes for having to type function(){} intead of />. I prefer />.

Powerful idioms

Here are a couple of functions I use in OpenEpi.jQueryMobile for loading modules and templates, in CoffeeScript, and JavaScript:

[gist id=4687639]


[gist id=4687639 file=gistfile5.js]

[gist id=4687639]


[gist id=4687639 file=gistfile6.js]


The (args...) syntax indicates a "splat" in CoffeeScript. Check it out here.  The other major feature in those Gists is the support for list comprehensions.

I have never been anti/JavaScript, so don't go there

CoffeeScript, to me, makes writing code more fun. I am by no means anti/JavaScript. Not even close.  When I was in college, I volunteered with, and I used to sit in the IRC chat channel with those folks and they helped me figure out the underlying C engine for JavaScript, and I wrote bindings that let you create Gtk+ apps on the X/Windows desktop in Linux using JavaScript. I wrote the first GUI on top of ChatZilla, the IRC client that Rob Ginda created which later was bundled with Mozilla. I also wrote a module for SWIG, called SwigJS, that let you generate the C or C++ glue code to create a JavaScript layer on top of it, including the ability to "object/orientify" a C/style Object Oriented API, like Gtk+. Anyway, I'm glad to see JavaScript finally getting it's due, but I still prefer to use easier to type and understand approaches like CoffeeScript to generate the JavaScript that ultimately executes :/D

Series Conclusion

This concludes the Developing Custom VersionOne Apps 101 Series Guide, at least for tonight :)Thank you for reading, and I'd love your feedback or collaboration!

More from the Blog

View more Government Cloud
Apr 12, 2022 Government Cloud receives FedRAMP Authorization through sponsorship from the United States Department of Veterans Affairs

Enterprise Agile Planning
Flagship Agility solutions can effectively scale agile deve ...
Read More
Nov 22, 2021

What are the qualities of highly effective agile teams?

Enterprise Agile Planning
A team is the core unit of productivity in an agile organization. Wher ...
Read More
Nov 15, 2021

How an open-first attitude revolutionized government tech development

Enterprise Agile Planning
Public perception of government is often that it is slow-moving, reluc ...
Read More
cross functional
Nov 08, 2021

6 best practices for building resilient cross-functional teams

Enterprise Agile Planning
Agile frameworks prize the quality of resilience within every facet of ...
Read More
Contact Us