Better JS with CoffeeScript - Sam Stephenson (37signals)
在线:http://vimeo.com/35258313
HD 下载:http://pan.baidu.com/s/1tdcQx
Sam Stephenson(https://github.com/sstephenson)
37singals 员工,基本上每个 Ruby 开发者都使用过他写的代码。
40mins 视频,声音清楚,用语也很简单,还是比较容易听懂的。
如果你有没用过 CoffeeScript,或者不清楚 CoffeeScript 相对于 JavaScript 来说有何优势,可以看一下世界顶尖的程序员是如何解释这个问题的。
一点建议:CoffeeScript 只是 JavaScript,CoffeeScript 是一个不错选择的大前提是,你已经掌握了相应的 JavaScript 技术。
主要内容:
-
Functions syntax (18:40 – 20:35) — greatly simplified, with much less typing
-
Significant white space (20:36 – 22:44) — indentation and line breaks replace braces, semicolons. Stephenson: “I see what I’m actually doing. Code looks clearer.”
-
Bare objects syntax (22:45 – 24:25) — makes for much greater coding efficiency
-
Everything’s an expression (24:36 – 25:50) — “Everything has a value.”
-
Comprehensions (25:51 – 28:19) — each, map, select made simple — and compiles to fast, good code
-
Classes and Inheritance (28:20 – 31:24) — “CoffeeScript makes it incredibly simple and terse to write classes.”
-
Bound functions (31:25 – 34:39) — the fat arrow => binds a function definition to its current scope, and can also be used to define instance methods
-
Conditionals (34:40 – 37:10) — greatly simplifies the writing of conditionals
-
Destructuring Assignment (37:11 – 38:06) — a proposal for the next version of JavaScript, already available in CoffeeScript
-
String Syntax (38:07 – 39:39) – does not require string concatenation. enables writing of multi-line strings (with indentation) between triple-quotes
http://alittlecode.com/coffeescript-intro-video-by-sam-stephenson-of-37signals/