10. Things that feel weird to
Parentheses are not optional on functions
with no arguments
11. Things that feel weird to
CoffeeScript’s in is Python’s in
Debugging (will get better, but currently
kind of a pain)
Changing versions (though it’s been
pretty stable for the last 5 months)
Less documentation (but there is a
book from PragProg...)
13. Even so!
After only a week of using CoffeeScript,
I felt more productive than I ever had in
The community is awesome.
Learning CoffeeScript might make you think
17. Compound extensions
.html.erb & .html.haml → HTML
.css.scss & .css.sass → CSS
Want to use a different format? Just rename!
application.js → application.js.coffee
18. Compound extensions
concatenated by Sprockets 2, even in development:
All the CSS and JS is loaded on every page, so it’s
still up to you to isolate controller-speciﬁc
21. Great, but...
Client-side validations are just there to
provide a friendlier user experience. What
really matters are server-side validations.
Traditionally, we’d do this by using
ActiveRecord, repeating much of the work
we just did...
But there’s another way!
If you’ve got coffee‐script in your
Gemﬁle, then you’ve already got ExecJS:
It uses the best available JS environment on
your system. Use therubyracer (or
therubyracer‐heroku) for maximum
23. No need to rewrite the
same validation code!
ExecJS lets us turn our CoffeeScript
validation code into a Ruby object:
24. A small taste of
what’s to come
Future plugins will make the server-side JS
process smoother in Rails
With jsdom, you can do practically anything
that you could do with client-side JS
(including manipulating HTML with jQuery!)
Validation, templating... anything you’re
duplicating can be done as end-to-end JS.
25. How can you become a
Ofﬁcial site, great overview:
Totally unbiased book recommendation: