Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love CoffeeScript. But then, I am well-versed in JavaScript. People who don't understand scope, lambdas, prototypes, etc. should stick to JavaScript, as CoffeeScript obscures some of that. You really should understand what's going on behind the scenes.

Which makes it all the stranger that experienced JavaScript developers seem to avoid it, while less experienced ones embrace it.

My main gripe with CoffeeScript (there are a couple, but here's one) is code organization/readability when a method takes multiple functions as arguments.

    foo ->
      bar()
      baz()
      quux()
    , (error) ->
      throw error if error
That does look a bit odd, and you run into these a lot when you're using caolan/async. You can avoid this by avoiding anonymous methods, but with so many callbacks in Node.js that is probably less readable.


You can assign the functions to variables and then make the function call in one line. Adds one line of code and a lot of readability.


Yes, but please see my last sentence. With so many callbacks in Node.js, it can make it just as difficult to follow.


I agree that function calls like that can get weird in coffee - I like to write them like this, which i think turns out to be a little more readable:

  foo(
    ->
      bar()
      baz()
      quux()

    (error) ->
      throw error if error
  )


Nodejs and Coffee are surely a nightmare. I've tried using async to improve code readability but it still doesn't fit well with coffee.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: