From 55e30bd0a5653697678d8e51181c4405c3db62ef Mon Sep 17 00:00:00 2001 From: Clay McClure Date: Fri, 1 Feb 2013 19:31:33 -0500 Subject: [PATCH 1/2] Clarify sentence about translation and compilation --- coffeescript/01_introduction.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coffeescript/01_introduction.html b/coffeescript/01_introduction.html index a399994..9329336 100644 --- a/coffeescript/01_introduction.html +++ b/coffeescript/01_introduction.html @@ -35,7 +35,7 @@

What is CoffeeScript?

More importantly though, JavaScript has a lot of skeletons in its closet which can often trip up inexperienced developers. CoffeeScript neatly sidesteps these by only exposing a curated selection of JavaScript features, fixing many of the language's oddities.

-

CoffeeScript is not a superset of JavaScript, so although you can use external JavaScript libraries from inside CoffeeScript, you'll get syntax errors if you compile JavaScript as-is, without converting it. The compiler converts CoffeeScript code into its counterpart JavaScript, there's no interpretation at runtime.

+

CoffeeScript is not a superset of JavaScript, so although you can use external JavaScript libraries from inside CoffeeScript, you'll get syntax errors if you attempt to execute it as-is, without first compiling it. The CoffeeScript compiler translates CoffeeScript code into JavaScript; there's no interpretation at runtime.

First to get some common fallacies out the way. You will need to know JavaScript in order to write CoffeeScript, as runtime errors require JavaScript knowledge. However, having said that, runtime errors are usually pretty obvious, and so far I haven't found mapping JavaScript back to CoffeeScript to be an issue. The second problem I've often heard associated with CoffeeScript is speed; i.e. the code produced by the CoffeeScript compiler would run slower than its equivalent written in pure JavaScript. In practice though, it turns out this isn't a problem either. CoffeeScript tends to run as fast, or faster than hand-written JavaScript.

@@ -78,4 +78,4 @@

Initial setup

- \ No newline at end of file + From fad2d03e724042103ef95011ecb22860d6e1d82d Mon Sep 17 00:00:00 2001 From: Clay McClure Date: Fri, 1 Feb 2013 19:42:35 -0500 Subject: [PATCH 2/2] Update the markdown source, as well --- coffeescript/chapters/01_introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffeescript/chapters/01_introduction.md b/coffeescript/chapters/01_introduction.md index 1bb39c2..d9cb294 100644 --- a/coffeescript/chapters/01_introduction.md +++ b/coffeescript/chapters/01_introduction.md @@ -12,7 +12,7 @@ So let's dive right into it; why is CoffeeScript better than writing pure JavaSc More importantly though, JavaScript has a lot of [skeletons in its closet](http://bonsaiden.github.com/JavaScript-Garden/) which can often trip up inexperienced developers. CoffeeScript neatly sidesteps these by only exposing a curated selection of JavaScript features, fixing many of the language's oddities. -CoffeeScript is *not* a superset of JavaScript, so although you can use external JavaScript libraries from inside CoffeeScript, you'll get syntax errors if you compile JavaScript as-is, without converting it. The compiler converts CoffeeScript code into its counterpart JavaScript, there's no interpretation at runtime. +CoffeeScript is *not* a superset of JavaScript, so although you can use external JavaScript libraries from inside CoffeeScript, you'll get syntax errors if you attempt to execute it as-is, without first compiling it. The CoffeeScript compiler translates CoffeeScript code into JavaScript; there's no interpretation at runtime. First to get some common fallacies out the way. You will need to know JavaScript in order to write CoffeeScript, as runtime errors require JavaScript knowledge. However, having said that, runtime errors are usually pretty obvious, and so far I haven't found mapping JavaScript back to CoffeeScript to be an issue. The second problem I've often heard associated with CoffeeScript is speed; i.e. the code produced by the CoffeeScript compiler would run slower than its equivalent written in pure JavaScript. In practice though, it turns out this isn't a problem either. CoffeeScript tends to run as fast, or faster than hand-written JavaScript.