node.js Taiwan 2012/03/16

992 views

Published on

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
992
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

node.js Taiwan 2012/03/16

  1. 1. node.js Taiwan2012/03/16
  2. 2. CoffeeScript• JavaScript: The Good Parts: • “JavaScript是披了C的衣服的Lisp”• CoffeeScript讓JS寫起來更簡潔
  3. 3. Foreach• JavaScript (ES5) 有forEach• Underscore.js 有 each / forEach ,效果完全相同• 簡單安全
  4. 4. Foreachvar array = [1, 2, 3] Oops.for (var i = 0; i <= array.length; i++) { var item = array[i]; alert(item);}JS for loop
  5. 5. Foreach (coffee)for num in [1, 2, 3] alert num
  6. 6. Foreach (js)_.each([1, 2, 3], function(num){ alert(num); });underscore.js_.each([1, 2, 3], alert);效果也相同[1, 2, 3].forEach(alert);Array.prototype.forEach (ES5)
  7. 7. ES5-shim• 古早瀏覽器的救星• https://github.com/kriskowal/es5-shim• 延伸閱讀• http://www.modernizr.com/
  8. 8. Variable Scope (coffee)sys = require sys https://github.com/jashkenas/coffee-script/issues/712foo = 42(() -> foo = 43)()sys.puts foo # 43sys = require sys‘my = (local) -> local()foo = 42my (foo) -> foo = 43sys.puts foo # 42
  9. 9. Form middleware• https://github.com/guileen/node-iform• Express寫起來會更簡潔
  10. 10. CoffeeScript in the Wild• Hubot by GitHub• http://hubot.github.com/• Spine (client-side MVC)• http://spinejs.com/
  11. 11. Node.js 台灣社群協作電子書• http://book.nodejs.tw/ • https://github.com/nodejs-tw/nodejs-wiki-book• 製作自己的電子書! • http://contpub.org/read/nodejs-wiki-book• reStructuredText • http://docutils.sourceforge.net/rst.html

×