Your SlideShare is downloading. ×
0
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...
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                       ...
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 Go...
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 " ...
( ) 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otyp...
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  ...
Happy Programming with CoffeeScript
Happy Programming with CoffeeScript
Happy Programming with CoffeeScript
Happy Programming with CoffeeScript
Happy Programming with CoffeeScript
Upcoming SlideShare
Loading in...5
×

Happy Programming with CoffeeScript

3,213

Published on

Published in: Technology
2 Comments
14 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,213
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
65
Comments
2
Likes
14
Embeds 0
No embeds

No notes for slide

Transcript of "Happy Programming with CoffeeScript"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×