Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>At this point, there are two answers to this question. Asawyer says you must know JavaScript to debug CoffeeScript. Trevor suggests that you should ideally be at least an intermediate level JavaScript programmer. I'll give you the third perspective. </p> <p><strong>The quickest way to proficiency at CoffeeScript is to start writing in CoffeeScript but expect to learn JavaScript as you go.</strong> You'll still need to learn a lot about Javascript including the standard objects (Object, Array, Date, Math, XHR, etc.). But other things you can learn from the CoffeeScript perspective. For instance, Trevor's book has a great chapter on jQuery. That's where I go whenever I need a refresher on DOM manipulation. Another example is scoping; once you understand the difference between skinny arrow and fat arrow (CoffeeScript concepts), you'll know the two good ways of handling closure scope in JavaScript.</p> <p>If you don't know object-oriented programming, I suggest you start with a book like the HeadFirst Design Patterns book eventhough it's java based because it's the quickest way I know to reprogram your brain for OO. It's tough to learn good OO practices starting with JavaScript... less hard with CoffeeScript.</p> <h3>Evidence</h3> <p>I have a background in Java, Python, and ActionScript but I started full bore on CoffeeScript only 3 months ago, and I've been able to ramp up quickly enough to have written 4,500 lines of production code including 2 original projects that assist with CoffeeScript development (<a href="https://github.com/lmaccherone/coffeedoctest">CoffeeDocTest</a>, and <a href="https://github.com/lmaccherone/LineCommands.codaplugin">Line Commands for Coda</a>) and my primary work on a tool for my PhD called <a href="https://github.com/lmaccherone/Lumenize">Lumenize</a> as well as contribute to two other CoffeeScript projects (<a href="https://github.com/lmaccherone/coffeedoc">coffedoc</a>, and <a href="https://github.com/lmaccherone/CoffeeScript.mode">CoffeeScript mode for Coda</a>). I have never explicitly set out to write or learn JavaScript.</p> <h3>Further logic</h3> <p>I don't base my conclusion solely on my own experiences. Here are other reasons:</p> <ol> <li><p>You can avoid the wasted time learning where all the warts are in JavaScript. I still don't know the difference between == and === and I don't care! [Update: Now I sorta do know the difference but who wants '1', the String to be == to 1, the Number? I'm still happy to use === everywhere]. In what browsers and under what circumstances is it safe to forget a semi-colon? Your code will work fine during your testing and then fail on someone else's browser. Sure there are tools like jslint but it takes time to ramp up the use of those. Going straight to CoffeeScript skips that time.</p></li> <li><p>You'll learn good OO habits for creating classes and inheritance easier in CoffeeScript than JavaScript.</p></li> <li><p>List comprehensions and language-supported for loops change your habits. JavaScript developers often use a functional callback style for iterating over collections ($().each() for instance). Using a functional style like this is <a href="http://jsperf.com/javascript-vs-jquery-foreach">much less efficient</a> but it's a much cleaner syntax than what JavaScript provides natively. With CoffeeScript, you get the speed of the native implementation with even better readability than the jQuery syntax.</p></li> <li><p>The debugging argument is overstated. All of the identifiers and the overall structure are maintained when the code is compiled. It's very easy to see your own code in the compiled JavaScript. At first, I had to study how my CoffeeScript was being converted but that's how I learned to write "good" JavaScript. Now, I can easily read the compiled JavaScript.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload