Recently, I stumbled upon a growing number of articles about frontend coding that used CoffeeScript in their examples. In particular, articles about Backbone.js.
While I’m not a fan of CoffeeScript, for various reasons, and wouldn’t tend to use it myself, I completely respect your right to disagree and don’t mind at all if you use it for your projects.
What I do mind, though, is the use of CoffeeScript to reason and present information about JavaScript and JavaScript libraries.
The reason should be self-evident from the previous sentence. If not, bear with me.
The best analogy I can think of for the transpiled relationship between JavaScript/CoffeeScript is HTML/Haml.
Take the following example:
%blockquote.film{:cite => "http://www.imdb.com/title/tt0062622/quotes"}
%p= Just what do you think you're doing, Dave?
%footer
= — HAL in 2001: A Space Odyssey
Which translates to:
<blockquote class="film"
cite="http://www.imdb.com/title/tt0062622/quotes">
<p>Just what do you think you're doing, Dave?</p>
<footer>— HAL in 2001: A Space Odyssey</footer>
</blockquote>
Even though there is a somewhat guessable syntactic mapping between the two, would you use such a Haml snippet to illustrate the use of <blockquote>
and <footer>
? Hopefully not.
No matter how much you enjoy the power of an alternative syntax, using it for anything else than demonstrating that syntax distracts the attention from what you’re actually writing about.
Just because you know how to map CoffeeScript to JavaScript (and really, you should know) doesn’t mean everybody does, or cares to.