News for hackers. Stuff that matters.
Re:CoffeeScript: less typing, bad readability by danenania on Tuesday September 18, 2012 @05:07AM (#4537077)
I much prefer this:

someFn(arg1, arg2, (-> doStuffInACallback()), arg3)

But far better, if you have any say in it, is making the callback the final argument to someFn.

someFn arg1, arg2, arg3, -> doStuffInACallback()

The thing about coffeescript is that most of the pitfalls being discussed here are very easily avoided with a modicum of experience and sense, whereas in javascript, many of the core issues simply cannot be avoided, and must be worked around in plainly ugly and bug prone ways (see: string concatenation, this/that juggling, "])})]));, just for starters).

There are no comments on this comment yet.