CoffeeScript Style Guide. Following style guides helps to keep your code consistent, readable, and organized.

EDIT: The only thing I don’t completely agree with is this:

Use spaces only, with 2 spaces per indentation level.

I personally prefer 4 spaces, and don’t see any inherent benefit to using 2 spaces over 4 (unless you need 2 characters to remain in the 79 characters-per-line guideline). Is there a reason (I’m apparently missing) as to why 2 is better than 4?

UPDATE: I was just informed that most coffee projects use 2 spaces for indentation, so if you plan on adopting CoffeeScript and possibly working with/on other projects, 2 spaces is what you should probably get used to using (and that is probably why the style guide says you should use 2 spaces).

To read more entries, visit the archives or subscribe to the RSS feed.