News for hackers. Stuff that matters.
Re:CoffeeScript, a little language that compiles to JavaScri... by jrockway on Thursday December 24, 2009 @03:41PM (#1014359)
This is nice. There are too many gotchas to remember in JavaScript; better to let a liberal compiler translate something nice into the "machine code" that works in all browsers.

(Personally, I always write:

   something = {
       foo: "bar",
       bar: "baz",
   }
which works in Firefox, but not IE. A compiler would not be upset when it omits that extra trailing comma. Of course, you can always write:

    something = { foo: "bar"
                , bar: "baz"
                }
But let's face it, that is only not ugly in Haskell.)
Re:CoffeeScript, a little language that compiles to JavaScri... by jashkenas on Thursday December 24, 2009 @05:40PM (#1014493)
Which is why CoffeeScript lets you leave commas out of multiline object and array literals (for those that didn't see catch it in there):

    something: {
      foo: "bar"
      bar: "baz"
    }
Re:CoffeeScript, a little language that compiles to JavaScri... by btilly on Thursday December 24, 2009 @05:38PM (#1014490)
If the second form works and avoids bugs, can't you train your eyes to accept it?

That's what I did in SQL a few years ago, and I can't count how many times it has helped me since.