Over a million developers have joined DZone.

CoffeeScript Style Guide

DZone's Guide to

CoffeeScript Style Guide

· Web Dev Zone
Free Resource

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

You may have come across the GitHub JavaScript Styleguide, which tells us to:

"Write new JS in CoffeeScript." 

 That alone is an awesome endorsement of the "little language", but there is more good advice:

"Follow @jashkenas's style. See the documentation for good examples." 

Without doubt, this is correct. The CoffeeScript home page should be your first stop for style. However, it's not strictly a style guide, so for a more dedicated resource I recommend  polarmobile/coffeescript-style-guide. It answers questions such as "tabs or spaces?", and I expect it will continue to grow, becoming a very comprehensive resource.

Of course, you could argue that in the age of computer automation, the best style guides are linters. CoffeeLint is described as "a style checker that helps keep CoffeeScript code clean and consistent." For style consistency across a team, it's likely to be a great choice.

Finally, as an example of good CoffeeScript style in the context of hairy, real-world programming, Jeremy Ashkenas recommends  the source code for the Pow server.

This list is by no means complete and is open for your contributions. Where do you go for great CoffeeScript style?

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


Published at DZone with permission of Chris Smith, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}