"It's just
JavaScript"
     coated with
     syntax sugar
Did
CoffeeScript attempts to expose

    you
those 'good parts'




    notice?
it's quite thin #nuffsaid
But its core
is gooooood
CoffeeScript
CoffeeScript attempts to expose
exposes those
those 'good parts'


 'good parts'
CoffeeScript attempts to expose
those 'good parts'
Ruby
Python
Haskell
# prototyping
String::downCase = -> @toLowerCase()

# functions, chained comparison
isMyAge = (age) ->
     24 < age < 26

# splat arguments, pattern matching
unCapitalize = (words...) ->
     (words.map ([firstChar, rest...]) -> firstChar.downCase() + rest.join '').join ''

# destructuring assignment, function binding
Me = ([surname, middlenames..., lastname] ) ->
    # string interpolation
    @name =         "#{surname} #{lastname}"

     # everything is an expression
     @age =         if isMyAge(x = 25) then x else '?'
     @twitter =     unCapitalize('@', surname, lastname)

     # use jQuery (or any JavaScript library), multi line Strings
     $('#welcome').bind 'click' (event) => alert "Hello,
                                                 I'm #{@name}!"
# there's no var!!
me = Me("Jeroen Matthijs Rosenberg".split ' ')
#nuffsaid
word.spread! for people in continents[..]
when people isnt aware

CoffeeScript

  • 3.
    "It's just JavaScript" coated with syntax sugar
  • 4.
    Did CoffeeScript attempts toexpose you those 'good parts' notice?
  • 5.
    it's quite thin#nuffsaid
  • 6.
  • 7.
    CoffeeScript CoffeeScript attempts toexpose exposes those those 'good parts' 'good parts'
  • 8.
    CoffeeScript attempts toexpose those 'good parts'
  • 9.
  • 10.
    # prototyping String::downCase =-> @toLowerCase() # functions, chained comparison isMyAge = (age) -> 24 < age < 26 # splat arguments, pattern matching unCapitalize = (words...) -> (words.map ([firstChar, rest...]) -> firstChar.downCase() + rest.join '').join '' # destructuring assignment, function binding Me = ([surname, middlenames..., lastname] ) -> # string interpolation @name = "#{surname} #{lastname}" # everything is an expression @age = if isMyAge(x = 25) then x else '?' @twitter = unCapitalize('@', surname, lastname) # use jQuery (or any JavaScript library), multi line Strings $('#welcome').bind 'click' (event) => alert "Hello, I'm #{@name}!" # there's no var!! me = Me("Jeroen Matthijs Rosenberg".split ' ')
  • 11.
  • 12.
    word.spread! for peoplein continents[..] when people isnt aware