官术网_书友最值得收藏!

Introduction

We are living in a time where JavaScript is becoming the most widely-used programming language in the world, even though it is not a language without its faults.

With its rise in popularity, JavaScript has become a legitimate option to develop all aspects of modern applications, applications that comprise a rich HTML/CSS/JavaScript client that communicates with backend services via AJAX. These applications can be run on desktops and mobile platforms as websites, mobile web, or hybrid applications using a native wrapper such as Apache Cordova / Adobe PhoneGap.

Node.js has helped JavaScript reach well beyond the boundaries of the web browser and into our operating systems themselves.

Tip

You might be surprised to know that Microsoft Windows has shipped with a JavaScript execution engine called Windows Script Host since Windows 98.

JavaScript, though very successful, can be a difficult language to work with. JavaScript was designed by Brendan Eich in a mere 10 days in 1995 while working at Netscape. As a result, some might claim that JavaScript is not as well rounded as some other languages, a point well illustrated by Douglas Crockford in his book titled JavaScript: The Good Parts, O'Reilly Media.

These pitfalls found in the JavaScript language led Jeremy Ashkenas to create CoffeeScript, a language that attempts to expose the good parts of JavaScript in a simple way. CoffeeScript compiles into JavaScript and helps us avoid the bad parts of JavaScript.

There are many reasons to use CoffeeScript as your development language of choice. Some of these reasons include:

  • CoffeeScript helps protect us from the bad parts of JavaScript by creating function closures that isolate our code from the global namespace by reducing the curly braces and semicolon clutter and by helping tame JavaScript's notorious this keyword
  • CoffeeScript helps us be more productive by providing features such as list comprehensions, classes with inheritance, and many others
  • Properly written CoffeeScript also helps us write code that is more readable and can be more easily maintained

As Jeremy Ashkenas says:

"CoffeeScript is just JavaScript."

We can use CoffeeScript when working with the large ecosystem of JavaScript libraries and frameworks on all aspects of our applications, including those listed in the following table:

We will look at each of these in depth throughout this book.

主站蜘蛛池模板: 昭平县| 云梦县| 马鞍山市| 阿瓦提县| 文山县| 舒城县| 井陉县| 都匀市| 枝江市| 吉林省| 疏勒县| 石城县| 纳雍县| 社旗县| 锡林郭勒盟| 观塘区| 泰和县| 从化市| 屏东县| 台州市| 九江县| 佛教| 沛县| 阳新县| 翁源县| 宁都县| 龙口市| 勃利县| 公安县| 武穴市| 福鼎市| 南昌县| 威宁| 嘉黎县| 高州市| 辽阳市| 高雄市| 蒙山县| 佛冈县| 扶余县| 德江县|