Happy Programming with CoffeeScript

  • 3,013 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Very well done, and informative.
    Are you sure you want to
    Your message goes here
  • I LIKE COFFEE
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
3,013
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
58
Comments
2
Likes
14

Embeds 0

No embeds

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. Happy Programming with CoffeeScript 高見見龍龍photo by yukop
  • 2. 高見見龍龍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
  • 3. Intro 簡介
  • 4. Popular
  • 5. PopularPowerful
  • 6. Popular PowerfulComplicaed
  • 7. Before photo by Razlan
  • 8. photo by Razlan Now
  • 9. seems easyphoto by apple apple
  • 10. photo by Marcus Q
  • 11. Today, I am going o ell you..
  • 12. Happy 快樂
  • 13. We’re not alking about this kind of coffee.photo by Nick Humphries
  • 14. Not this either.photo by naotoj
  • 15. I have no idea why engineers likeusing food as their project name.
  • 16. JeremyAshkenas photo by jsconf
  • 17. 2009/12
  • 18. and I sared o useCoffeeScript since 2011/5
  • 19. and I sared o useCoffeeScript since 2011/5 because of Rails
  • 20. yet another new language !?
  • 21. "Its just JavaScript"
  • 22. just writen in different synax
  • 23. borrowed fromPython, Ruby and Haskell.
  • 24. and would be compiled ino JavaScript code
  • 25. JSLint Compatible
  • 26. So, its still Javascript
  • 27. "hmm.."
  • 28. "Its just JavaScript"
  • 29. "Its just JavaScript"
  • 30. "I think its just CoffeeScript"
  • 31. whaever..WTH can you do with CoffeeScript?
  • 32. anything which JavaScript can do.
  • 33. front-end, back-end, mobile.. ec.
  • 34. but with less line of code.. ~ 30% off
  • 35. CoffeeScript compiler is writen in CoffeeScript
  • 36. Is JavaScript that bad?photo by Bryan Gosline
  • 37. the good partsphoto by Steve Ganz
  • 38. CoffeeScript =English-like grammar +nice Synactic Sugar + Goodies
  • 39. Syntax 語法
  • 40. indenations rule,whiespace maters!
  • 41. } } }}
  • 42. } } }}
  • 43. String Inerpolation
  • 44. greeting = "hi, " + name + ", " + msg
  • 45. greeting = "hi, #{name}, #{msg}"
  • 46. semicolon
  • 47. semicolon
  • 48. var
  • 49. var
  • 50. ->
  • 51. say_hello = (msg) -> console.log "hello, JSDC"
  • 52. var say_hello;say_hello = function(msg) { return console.log("hello, JSDC");};
  • 53. default parameer
  • 54. say_something = (msg = "JSDC") -> console.log "say #{msg}"
  • 55. var say_something;say_something = function(msg) { if (msg == null) { msg = "JSDC"; } return console.log("say " + msg);};
  • 56. ( ) is not always necessary.
  • 57. greeting("eddie", "how are you");
  • 58. greeting "eddie", "how are you"
  • 59. everything is an expression
  • 60. return is not necessary.
  • 61. var hello;hello = function() { return "hi, JSDC";};
  • 62. hello = -> "hi, JSDC"
  • 63. Array
  • 64. var a;a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  • 65. a = [1..10]
  • 66. Loop
  • 67. console.log i for i in [1..10]
  • 68. var i, _i;for (i = _i = 1; _i <= 10; i = ++_i) { console.log(i);}
  • 69. console.log "YES" if oday == JSDC
  • 70. Sugar
  • 71. yes, no
  • 72. A: “would you marry me?” B: true
  • 73. A: “would you marry me?” B: yes
  • 74. console.log "go home" if oday isnt "JSDC"
  • 75. OO
  • 76. Hello.prootype.greeting = function(name) { console.log("hi, " + name);};
  • 77. class Hello greeting: (name) -> console.log "hi, #{name}"
  • 78. class Hello construcor: (@name) -> greeting: (msg) -> "hi, #{@name}, #{msg}"
  • 79. 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;})();
  • 80. Diff? 差別?
  • 81. the Original Way Your Brain JavaScript Browser
  • 82. the CoffeeScript way Your Brain CoffeeScript JavaScript Browser
  • 83. lots of languages that compile o JS http://goo.gl/nkAkQ
  • 84. Ref參考
  • 85. RTFM, its awesome! http://coffeescript.org/
  • 86. or my shameless promotion blog http://blog.eddie.com.tw/caegory/coffeescript/
  • 87. Let’s get our feet wet!photo by jlhopes
  • 88. Demo 展示
  • 89. But.. 巴特..
  • 90. CoffeeScript is not so perfect
  • 91. Readability != Comprehension
  • 92. People may still wrieCoffeeScript as horribly as they wroe JavaScript..
  • 93. indenations rule,whiespace maters!
  • 94. ( ) is not always necessary.
  • 95. Debugging ool?
  • 96. Youve beter have a humanCoffeeScript compiler in your head!
  • 97. Then.. 然後..
  • 98. CoffeeScript is not used o replace JavaScript.
  • 99. If you don’t know Javascript, andyou think CoffeeScript can saveyour life..
  • 100. you would be in trouble.
  • 101. So.. 所以..
  • 102. Who is using CoffeeScript?
  • 103. actually, I dont really care!
  • 104. Who wont need this?
  • 105. People who dont like CoffeeScript.
  • 106. People who already knowjavascript(the good parts) verywell.
  • 107. Who might need/like this?
  • 108. someone who dont like ;
  • 109. someone who dont like { }
  • 110. someone who dont like the PROTOTYPE.
  • 111. Rails developer
  • 112. Anyway 總之
  • 113. Should I learn CoffeeScript?
  • 114. Is it worth it?
  • 115. IMHO 拙見
  • 116. You should..
  • 117. learn JavaScript!
  • 118. learn JavaScript!
  • 119. learn JavaScript!
  • 120. learn JavaScript!
  • 121. .. and use CoffeeScript !
  • 122. oally worth it!
  • 123. I cant go back anymore!
  • 124. give it a try
  • 125. Happy? 快樂?
  • 126. END 結束
  • 127. 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