Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
(why|what is) CoffeeScript?
tl;dr: no more
})})));});, meaningful indentation makes your code look beautiful!
So if you already know JS, it should be super easy for you to learn it: go to the official website to learn from the (quite short) doc, or read a (free) book such as The Little Book on CoffeeScript. You can also play with JS2Coffee to experiment with the differences.
### Syntax Master rule: Prefer code readability over cleverness
For the rest, we are largely following those guidelines & conventions:
[Update]: the projects conventions actually sensibly diverged from the two reference above. Ideally, those should comprehensively listed here, but it the meantime, simply take inspiration from the existing code convention and open an issue if you see inconsistencies.
### Notable Influences
Uses promises flow as a clean summary of the functions called, using partials functions.
user_.getUserId req .then items_.verifyOwnership.bind(null, id) .then items_.delete.bind(null, id, rev) .then res.json.bind(res) .catch error_.Handler(res)
items_.delete.bind(null, id, rev) over
_.partial(items_.delete, id, rev)
It makes promises flows a more explicit summary by highlighting the function used instead of the fact it is a partial
Functions returning functions should have their name capitalized.
error_.Handler, a functions typically used in controllers promises flow: