Happy Programming with CoffeeScript
Upcoming SlideShare
Loading in...5
×
 

Happy Programming with CoffeeScript

on

  • 3,340 views

 

Statistics

Views

Total Views
3,340
Views on SlideShare
3,029
Embed Views
311

Actions

Likes
13
Downloads
56
Comments
2

8 Embeds 311

http://www.scoop.it 290
http://us-w1.rockmelt.com 6
http://localhost 6
http://www.onlydoo.com 3
http://adityasrinivas.tumblr.com 2
https://twimg0-a.akamaihd.net 2
https://si0.twimg.com 1
http://webcache.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Very well done, and informative.
    Are you sure you want to
    Your message goes here
    Processing…
  • I LIKE COFFEE
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Happy Programming with CoffeeScript Happy Programming with CoffeeScript Presentation Transcript

  • Happy Programming with CoffeeScript 高見見龍龍photo by yukop
  • 高見見龍龍a.k.a Eddie or Aquarianboy Live and work in Taipei, Taiwan. Serving in my own little tiny company. Flash / AS3 / Ruby / Rails / Python programming for living. Mac OS user, Objective-C for personal inerests. Technical Education and Consulant. PTT Flash BM (since 2007/4). Ruby Certified Programmer (Since 2012/1). Adobe Certified Flash Developer (Since 2006/7). Linux Professional Institue Certification (Since 2005/3). photo by Eddie
  • Intro 簡介
  • Popular
  • PopularPowerful
  • Popular PowerfulComplicaed
  • Before photo by Razlan
  • photo by Razlan Now
  • seems easyphoto by apple apple
  • photo by Marcus Q
  • Today, I am going o ell you..
  • Happy 快樂
  • We’re not alking about this kind of coffee.photo by Nick Humphries
  • Not this either.photo by naotoj
  • I have no idea why engineers likeusing food as their project name.
  • JeremyAshkenas photo by jsconf
  • 2009/12
  • and I sared o useCoffeeScript since 2011/5
  • and I sared o useCoffeeScript since 2011/5 because of Rails
  • yet another new language !?
  • "Its just JavaScript"
  • just writen in different synax
  • borrowed fromPython, Ruby and Haskell.
  • and would be compiled ino JavaScript code
  • JSLint Compatible
  • So, its still Javascript
  • "hmm.."
  • "Its just JavaScript"
  • "Its just JavaScript"
  • "I think its just CoffeeScript"
  • whaever..WTH can you do with CoffeeScript?
  • anything which JavaScript can do.
  • front-end, back-end, mobile.. ec.
  • but with less line of code.. ~ 30% off
  • CoffeeScript compiler is writen in CoffeeScript
  • Is JavaScript that bad?photo by Bryan Gosline
  • the good partsphoto by Steve Ganz
  • CoffeeScript =English-like grammar +nice Synactic Sugar + Goodies
  • Syntax 語法
  • indenations rule,whiespace maters!
  • } } }}
  • } } }}
  • String Inerpolation
  • greeting = "hi, " + name + ", " + msg
  • greeting = "hi, #{name}, #{msg}"
  • semicolon
  • semicolon
  • var
  • var
  • ->
  • say_hello = (msg) -> console.log "hello, JSDC"
  • var say_hello;say_hello = function(msg) { return console.log("hello, JSDC");};
  • default parameer
  • say_something = (msg = "JSDC") -> console.log "say #{msg}"
  • var say_something;say_something = function(msg) { if (msg == null) { msg = "JSDC"; } return console.log("say " + msg);};
  • ( ) is not always necessary.
  • greeting("eddie", "how are you");
  • greeting "eddie", "how are you"
  • everything is an expression
  • return is not necessary.
  • var hello;hello = function() { return "hi, JSDC";};
  • hello = -> "hi, JSDC"
  • Array
  • var a;a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  • a = [1..10]
  • Loop
  • console.log i for i in [1..10]
  • var i, _i;for (i = _i = 1; _i <= 10; i = ++_i) { console.log(i);}
  • console.log "YES" if oday == JSDC
  • Sugar
  • yes, no
  • A: “would you marry me?” B: true
  • A: “would you marry me?” B: yes
  • console.log "go home" if oday isnt "JSDC"
  • OO
  • Hello.prootype.greeting = function(name) { console.log("hi, " + name);};
  • class Hello greeting: (name) -> console.log "hi, #{name}"
  • class Hello construcor: (@name) -> greeting: (msg) -> "hi, #{@name}, #{msg}"
  • var Hello;Hello = (function() { Hello.name = Hello; function Hello(name) { this.name = name; } Hello.prootype.greeting = function(msg) { return "hi, " + this.name + ", " + msg; }; return Hello;})();
  • Diff? 差別?
  • the Original Way Your Brain JavaScript Browser
  • the CoffeeScript way Your Brain CoffeeScript JavaScript Browser
  • lots of languages that compile o JS http://goo.gl/nkAkQ
  • Ref參考
  • RTFM, its awesome! http://coffeescript.org/
  • or my shameless promotion blog http://blog.eddie.com.tw/caegory/coffeescript/
  • Let’s get our feet wet!photo by jlhopes
  • Demo 展示
  • But.. 巴特..
  • CoffeeScript is not so perfect
  • Readability != Comprehension
  • People may still wrieCoffeeScript as horribly as they wroe JavaScript..
  • indenations rule,whiespace maters!
  • ( ) is not always necessary.
  • Debugging ool?
  • Youve beter have a humanCoffeeScript compiler in your head!
  • Then.. 然後..
  • CoffeeScript is not used o replace JavaScript.
  • If you don’t know Javascript, andyou think CoffeeScript can saveyour life..
  • you would be in trouble.
  • So.. 所以..
  • Who is using CoffeeScript?
  • actually, I dont really care!
  • Who wont need this?
  • People who dont like CoffeeScript.
  • People who already knowjavascript(the good parts) verywell.
  • Who might need/like this?
  • someone who dont like ;
  • someone who dont like { }
  • someone who dont like the PROTOTYPE.
  • Rails developer
  • Anyway 總之
  • Should I learn CoffeeScript?
  • Is it worth it?
  • IMHO 拙見
  • You should..
  • learn JavaScript!
  • learn JavaScript!
  • learn JavaScript!
  • learn JavaScript!
  • .. and use CoffeeScript !
  • oally worth it!
  • I cant go back anymore!
  • give it a try
  • Happy? 快樂?
  • END 結束
  • Conacts高見見龍龍 Websie Blog http://www.eddie.com.tw http://blog.eddie.com.tw Plurk http://www.plurk.com/aquarianboy Facebook http://www.facebook.com/eddiekao Google Plus http://www.eddie.com.tw/+ Twiter https://twiter.com/#!/eddiekao Email eddie@digik.com.tw Mobile +886-928-617-687 photo by Eddie