b0fwdq
Last Updated: March 15, 2018
·
1.071K
· gabeio
9c7e4f496360fb56a2073bf04ae1ee90

Falling in love with coffee all over again.

The title is actually a double entendre because Starbucks helped me to fall in love with the real stuff. And the simplicity behind CoffeeScript helped me to fall in love with node.js.

Just taking into account that with CoffeeScript you don't need all the excessive brackets, semi-colons and etcetera that goes along with most languages that are this fast. Had me falling in love at first glance.

CoffeeScript(9 characters):

a=b=c="a" 

JavaScript(31 characters):

var a,b,c; 
a="a"; 
b="a"; 
c="a"; 

or (21 characters[without spaces])

var a="a", 
    b="a", 
    c="a"; 

Functions:

a = (a,b,c) -> a+b+c

vs

function a (a,b,c){
  return a+b+c;
}

the simplicity and compactness is what makes this language amazing.

Say Thanks
Respond

3 Responses
Add your response

8471

what about readability? :)

over 1 year ago ·
17663
1625660 10152656935577922 3233648390156803618 n 2

I <3 Coffeescript :)

Just as a reminder, JS lets you do assignments like

var a, b, c;
a = b = c = "a";
over 1 year ago ·
29750
Shane with coffee square

I love CoffeeScript. I think it is way more readable than JavaScript. To each their own!

In fact, I love CoffeeScript so much, I wanted something even better. I took the best parts of CoffeeScript(v2) and made them even better: CaffeineScript.com.

I started with one really frustrating inconsistency in CoffeeScript:

# OK in CoffeeScript (and CaffeineScript)
myFunction 
  prop1: 123
  param1
  param2

# swap the first two parameters, and...
# NOT OK in CoffeeScript (but OK in CaffeineScript!)
myFunction 
  param1
  prop1: 123
  param2

And that was just the beginning...

More on specific improvements over CoffeeScript here: https://github.com/caffeine-suite/caffeine-script/wiki/Coming-from-CoffeeScript

I'd love to get feedback from a fellow CoffeeScript lover.

2 months ago ·