CoffeeScript the Awesome

download

of 25

  • date post

    20-Jan-2015
  • Category

    Technology

  • view

    1.304
  • download

    1

Embed Size (px)

description

Coffee

Transcript of CoffeeScript the Awesome

  • 1.

2. CoffeeScript
The Awesome
3. A Propos de Moi
@kouphax
http://yobriefca.se
http://github.com/kouphax
4. 5. A Few CoffeeScript Facts
Created by Jeremy Ashkenas circa late 2009
Spawned from reading Create Your Own Programming Language
CoffeeScript compiles to, and executes as, JavaScript in the browser.
CoffeeScript simply offers an initial compilation step prior to the JavaScript being interpreted what's the harm in that?
CoffeeScript does not require you to abandon all your JS libraries
Yes you can still use jQuery or anything else you want
JavaScript produced by the CoffeeScript compiler is performant, valid and well formatted.
6. Debugging CoffeeScript directly is currently not possible so this adds another layer of complexity
In reality mapping between CoffeeScript and the generated JavaScript isnt difficult
Could be considered just syntactical sugar with some extra syntax benefits
No more random semi-colon insertion
No more accidental global scoping of declarations
Scopingsyntax built right in
Automatic hoisting of variable declarations
Not everyone is a massive fan
A Few (More) CoffeeScript Facts
7. 8. Range Compreshension
English Notation
Variable Declaration
Function Declaration
String Interpolation
Function Call
Loop Comprehension
* Never do this in real life kthanxai
9. 10. CoffeeScript: A Guided Tour
- or -
CoffeeScript: A Guided Tour of the Website, Pretty Much, Except in Slide Form but Not Because I am Lazy, No,More so Because Its a Fairly Comprehensive Document of the Features of CoffeeScript.
11. Functions
12. Functions
13. Objects
14. Conditionals
15. Operators and Aliases
16. Splats
17. Loops and Comprehensions
18. Array Slicing and Ranges
19. Classes
20. Odds and Ends
21. Using CoffeeScript in .NET
- or -
What?You think wed let those script kiddies have all the fun?Hells no!
22. Compile On Demand
Shameless Plug
(but I am distracting you through the use of Comic Sans)
and others
23. Pre-compile
24. 25. Questions?