3 ms·
I'm a programming language geek, a code lover and a syntax fanatic. And there are a ton of things I love about coffee-script: class Animal # yeah! real cla
by tiglionabbit 12y ago
I'm a programming language geek, a code lover and a syntax fanatic. And there are a ton of things I love about coffee-script:
class Animal # yeah! real classes!
hello: (name="nobody") -> # nice default variables
console.log "hi #{name}" # sexy variable expansion!
class Dog extends Animal # logical syntax :)
...
f = ->
x=123 # variables are local by default and need no initialisation
- xyby 12y agoCoffeeScript is interesting. So far I did not experiment with it too much. So I'm not sure if I would like to do work in it. On one hand, it looks nicely terse. On the other hand it looks a bit cryptic. The thing that stops me from trying it for a project is not the language, but the available environments. Having an additional compliation step adds complexity to the system and the workflow. One thing I cannot resist to say is that to me "hello $name" is sexier then "hello #{name}" :)
- tiglionabbit 12y agoWell sure, but you can put arbitrary expressions in the #{} syntax. PHP has a similar syntax for that. I just run `coffee -wc .` on my source directory and pretend I'm using JavaScript everywhere else.