- Notifications
You must be signed in to change notification settings - Fork0
markbrown4/eloquentcoffee
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Marijn Haverbeke'sEloquent JS is an excellentbook, here's my solutions to the exercises written in CoffeeScript.
npm install coffeescript -gcoffee 1-triangle.coffee
The golden rule of CoffeeScript is: “It’s just JavaScript.”
As the ES6 train gained a lot of momentumcoffee
lost steam. However,the trendsstill show download growth over the past few years and there's still a lot of bigprojects using it.
Version 2 changed the compilation target from ES3 to ES2015 and aligned with newlanguage features like ES2015 Modules, classes, template literals, async / awaitand destructuring. Now that both languages are close to feature parity, the onlycompelling reason to write CoffeeScript is the clean expressive syntax.
I wrote CoffeeScript every day for fours years and then ES6+ for the last two,I've just been reacquainted and it's still a pleasure to program in. Keep an openmind and give it a try, you may enjoy it.
- Clarity of the program shines through with less syntax and significant whitespace
- Everything is an expression, statements like
for
,if
andswitch
produce a value - Implicit
return
of last statement - Aliases, operators & shorthands allow for more expressive code