A prettied-up pig has never looked so good.
1 – WHAT IS COFFEESCRIPT
2 – WHAT COFFEESCRIPT IS USED FOR
3 – WHY COFFEESCRIPT IS POPULAR
4 – THE PROS:
SWEETEN ME UP
Of course, the big upside here is the syntactic sugar added to CoffeeScript to make it much easier to express your programming while using significantly less code. Dustings of Ruby, Python, and Haskell make life so much easier.
EMBRACE THE GOOD
REJECT THE BAD
The variables in CoffeeScript are auto-scoped, meaning you can’t really overwrite globals by forgetting to type “var” in, shadowing a variable with the same name, or have variables interacting in separate files.
CALL ME MAYBE
The omission of the word function and it’s associated curly wurley parentheses, in lieu of a simple “->” arrow, makes call-backs a hell of a lot easier to do. Semantic indentation makes it clear when call-backs are nested, and likewise, that little arrow helps to preserve the “this” when it’s appropriate to do so.
USE LESS BRAIN CELLS
As an English speaker, it’s way easier to use “unless x” instead of getting your head around the clunky syntax of “if (!x)”, as well as “if x?” being easier to parse than “if (x = != null)”. Brain cells are precious, so allocating them to working the logic instead of working out the logic of the syntax seems like a better use of your cranial resources.
5 – THE CONS
Odds are if you hate Ruby, Python, or Haskell – you’ll hate CoffeeScript as well. A programmer will generally be more productive in a language they actually like programming in – which may seem like a no brainer, but it’s something that’s often overlooked.
PARLE VU COFFEESCRIPT
HOW TO LEARN COFFEESCRIPT
In our opinion, these are the 5 best online resources to learn CoffeesScript – a full range from absolute beginner to grisly programming veteran. Hey, most of them are even free – music for the ears if you’re a cheapskate!
As it turns out, the documentation on the CoffeeScript official website is fantastic. It’s all inclusive, and explains the syntax and capabilities of the programming language extremely well – worth looking at first, definitely.
After sinking your teeth into the basics, why not take a look at The Little Book On CoffeeScript to start looking at more examples of what can be done using the language.
Intermediate to advanced programmers would do well to keep the CoffeeScript Cookbook open in their browser. It gets into the nitty gritty of the language, and has some awesome cheat sheets to act as a quick referral while coding.
If you’re more of a visual learner, take a look at this 12-part series of videos that go through how to use CoffeeScript as an easy to follow, step by step process.
Expert level programmers may want a more in depth look into the nuances of the CoffeeScript programming language, and may do well to skip the beginner and intermediate resources and head straight for the heavy stuff.
We hope this article helped you learn more about Coffeescript and why you should give it a try!
If you enjoyed this article you may also enjoy Rustlang vs. C++ Which Language Should You Learn in 2021 or P5JS and 5 Things You Need To Know About It.