Coffeescript
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Coffeescript

  • 1,397 views
Uploaded on

I was cleaning up my files this morning, and found this short little intro talk I gave at Winnipeg.RB a few months back when rails 3.1 came out with CoffeeScript enabled by default. ...

I was cleaning up my files this morning, and found this short little intro talk I gave at Winnipeg.RB a few months back when rails 3.1 came out with CoffeeScript enabled by default.

It's a micro introduction to C

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,397
On Slideshare
1,181
From Embeds
216
Number of Embeds
1

Actions

Shares
Downloads
11
Comments
0
Likes
0

Embeds 216

http://coderwall.com 216

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. CoffeeScript Like JavaScript, but without the horrible.Sunday, 27 November, 11
  • 2. Burke Libbey Me @burkelibbeySunday, 27 November, 11
  • 3. The 5 Second PitchSunday, 27 November, 11
  • 4. var foo = function() { JavaScript return "bar"; } CoffeeScript foo = -> "bar"Sunday, 27 November, 11
  • 5. “Sold! What did I just buy?”Sunday, 27 November, 11
  • 6. “CoffeeScript is a little language that compiles into JavaScript” – Jeremy Ashkenas, CoffeeScript authorSunday, 27 November, 11
  • 7. foo = -> "bar" CoffeeScript Compiler (function() { var foo; foo = function() { return "bar"; }; }).call(this);Sunday, 27 November, 11
  • 8. “What’s wrong with JavaScript?” Browser inconsistencies Terrible DOM API Redundant syntaxSunday, 27 November, 11
  • 9. “What’s wrong with JavaScript?” Browser inconsistencies Terrible DOM API Redundant syntax Most of the issues people have with JavaScript boil down to these three points.Sunday, 27 November, 11
  • 10. “What’s wrong with JavaScript?” Browser inconsistencies Terrible DOM API Redundant syntax jQuery does a fantastic job of shielding you from these two.Sunday, 27 November, 11
  • 11. “What’s wrong with JavaScript?” Browser inconsistencies Terrible DOM API Redundant syntax CoffeeScript fixes this one.Sunday, 27 November, 11
  • 12. So what’s wrong with the syntax? function(x) { return x * x; } For a functional language, having to write “function” and “return” everywhere is more than a little strange.Sunday, 27 November, 11
  • 13. Anonymous Function Syntax JavaScript function(x) { return x * x; } Scheme (lambda (x) (* x x)) Erlang fun(X) -> X * X end. CoffeeScript (x) -> x * x Haskell x -> x * x Clojure #(* % %)Sunday, 27 November, 11
  • 14. “I’m a masochist, and I like typing a lot. Give me another reason.”Sunday, 27 November, 11
  • 15. Rails 3.1 includes CoffeeScript by default.Sunday, 27 November, 11
  • 16. ...to the chagrin of hypocrites the world over.Sunday, 27 November, 11
  • 17. Sunday, 27 November, 11
  • 18. Fighting Rails is usually doomed to failure.Sunday, 27 November, 11
  • 19. So just suck it up and learn CoffeeScript.Sunday, 27 November, 11
  • 20. Without further ado: CoffeeScript Whirlwind tourSunday, 27 November, 11
  • 21. three = -> 3 square = (x) -> x * x add = (x, y) x + ySunday, 27 November, 11
  • 22. Default values! fill = (container, liquid = "coffee") -> "Filling the #{container} with #{liquid}..." ...and string interpolation!Sunday, 27 November, 11
  • 23. YAML-like hash literals work kids = brother: name: "Max" age: 11 sister: name: "Ida" age: 9Sunday, 27 November, 11
  • 24. Never type “var” again! CoffeeScript does it for you.Sunday, 27 November, 11
  • 25. mood = greatlyImproved if singingSunday, 27 November, 11
  • 26. if happy and knowsIt clapsHands() chaChaCha() else showIt()Sunday, 27 November, 11
  • 27. date = if friday then sue else jillSunday, 27 November, 11
  • 28. options or= defaultsSunday, 27 November, 11
  • 29. I’m out of slides. Time for live-coding!Sunday, 27 November, 11
  • 30. Thanks!Sunday, 27 November, 11