Using Coffeescript In A Production Environment
Solution 1:
The language has been stable for the last six months (1.1.1 is basically just 1.0 with bugfixes). That's no guarantee of future stability, but I don't expect my book to be totally obsolete any time soon.
I'd say the best practices for avoiding version issues are
- Make sure you document the version of CoffeeScript that your project was written for, and
- Compile to JS under that version and keep the JS stored somewhere
- Have good test coverage (in the words of Samuel Adams: Always a good decision!)
That way, when a new version of CoffeeScript is released, you have a JS backup to use in case your CoffeeScript code is broken. Breaking changes are a pain, but they're a pain common to nearly all languages except JavaScript—just ask a Rubyist who recently made the transition from 1.8 to 1.9, or a Pythonista who's still migrating their Python 2 code to Python 3.
The advice I can give for preventing your code from breaking under CoffeeScript version changes is to avoid syntactic edge cases. For example, func a:b, c
used to mean func {a:b, c:c}
, and now it means func {a:b}, c
. That's an improvement (the old behavior was considered a bug), but some folks were caught off-guard by it. So use explicit punctuation whenever there's a hint of ambiguity; it makes for more readable code anyway.
Jeremy will have to comment on the stable
/master
distinction, since both branches exist but stable
hasn't been updated since April (pre-1.1.0).
Post a Comment for "Using Coffeescript In A Production Environment"