Monday, November 05, 2012

Do Not Use CoffeeScript

CoffeeScript is not a framework. It is used to generate readable, clean, tight and safe Javascript code.

1. Python style whitespacing
2. Ruby styled lightweight syntax

    var validate = function(form) {
      var required_field_names = ['name','email'];
      return false;
    validate = (form) ->
      required_field_names = ['name','email']
      return false

CoffeeScript returns the result of the last expression in a function
    validate = (form) ->
      required_field_names = ['name','email']

Though there are many reasons to use CoffeeScript.The biggest reason I decided not to use CoffeeScript is debugging. When you debug your web app, you see javascript. What you see is not what you wrote.