Hacker Newsnew | comments | show | ask | jobs | submit login

Most of the bad code examples in this post are taken from the CoffeeScript compiler itself. For that I have to say "mea culpa". There's a lot of overly clever and dense bits that have accrued in the compiler over time -- sometimes due to the tangly nature of the codebase, but also sometimes because we tend to use the self-hosted compiler as a test bed for edge cases of combining different language features together.

If you're looking for more regular style, this style guide is a better place to start:

https://github.com/polarmobile/coffeescript-style-guide




Perhaps a style guide should be put up at coffeescript.org, or at least linked to.

-----


I was literally coming here to post this response. It seems like a revolution in (usage of) coffeescript is needed in much the same way Crockford's Good Parts paved the way for writing good javascript.

Note: I'm not saying Crockford was singularly responsible for this, but The Good Parts was certainly well-received and very much popularised for it's opinionated views on the language.

Edit: I mean in terms of coding style, CS itself has already cut out a lot of The Bad Parts of JS

-----


Perhaps a style guide should just be encoded into the compiler.

-----


I feel like CoffeeScript is failing at what it's attempting to do if it needs its own style guide.

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: