- CoffeeScript Application Development
- Ian Young
- 347字
- 2021-04-09 23:58:29
Why CoffeeScript?
CoffeeScript was certainly not the first (or last) language to target JavaScript platforms. Many established languages, such as Ruby, Python, C, and Java have one or more projects focused on compiling that language to JavaScript. And other languages have been developed specifically to target JavaScript—notably Dart, TypeScript, and Coco.
Note
The CoffeeScript wiki itself maintains an extensive list of other languages that compile to JavaScript. You can find it at https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS.
While it's not alone in its approach, CoffeeScript has seen the most success of any language that compiles to JavaScript. It is the tenth most popular language on GitHub, it ships by default with Ruby on Rails, and it has large followings in both client-side and server-side developer communities.
So what makes CoffeeScript special? Just like Goldilocks and her pilfered porridge, CoffeeScript derives its strength from being just right. It is a marked improvement over JavaScript; we'll spend much of this book learning how CoffeeScript can help us write code that is more concise, easier to read, and less prone to bugs. However, CoffeeScript does not overreach on features. CoffeeScript has little to no runtime of its own—there is no extra metadata to track, no extra memory management, no non-standard data structures. Instead, CoffeeScript compiles directly to ordinary-looking JavaScript, much like what an experienced JavaScript developer might write. In fact, CoffeeScript is less a new language than it is a shorthand for easily expressing the best practices of JavaScript.
CoffeeScript is an eminently pragmatic language, and this is the secret to its success. It's easy for JavaScript developers to learn, and most expertise carries over. It doesn't incur performance penalties over plain JavaScript. CoffeeScript and JavaScript can coexist peacefully, so it's easy to introduce CoffeeScript into existing JavaScript projects. Perhaps most importantly, CoffeeScript avoids the "magic" that is so often a source of bugs when the developer's assumptions don't match the language designer's assumptions. With CoffeeScript, it's very easy to understand what the resulting JavaScript will do and how it will behave.
It might also help that CoffeeScript is fun.
- Celtx: Open Source Screenwriting Beginner's Guide
- 剪映專業版(電腦版)視頻剪輯全攻略:音效添加+轉場特效+視頻制作
- 鍵盤錄入技術(第2版)
- 移動App測試的22條軍規
- Photoshop CS6從入門到精通
- 視覺封王:Photoshop CC 2019立體化教程(素材+視頻+教案)
- 中文版Photoshop 2020基礎教程
- PowerPoint 2019從入門到精通(移動學習版)
- 音樂日記:Logic Pro X場景x風格編曲實用教程
- 3ds Max 2015中文版從入門到精通
- WordPress Theme Design
- Power Query從入門到精通
- Photoshop CC 2019 平面設計實例教程
- 3ds Max/VRay印象燈光/材質/渲染技術精粹Ⅲ
- Plone 3 for Education