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

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.

主站蜘蛛池模板: 万州区| 鲁甸县| 策勒县| 淮滨县| 郸城县| 竹北市| 东明县| 南皮县| 囊谦县| 信丰县| 萨嘎县| 伊金霍洛旗| 永福县| 绥中县| 普格县| 琼中| 晋江市| 永宁县| 北川| 五家渠市| 闸北区| 株洲县| 山丹县| 尚志市| 丹江口市| 京山县| 巩留县| 丰台区| 依兰县| 逊克县| 昆山市| 昌黎县| 左权县| 无极县| 潞西市| 新乐市| 嘉义县| 岳普湖县| 渭南市| 高密市| 乌鲁木齐市|