Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
CoffeeScript's Scoping is Madness (donatstudios.com)
5 points by donatj on July 25, 2013 | hide | past | favorite | 3 comments


I don't miss shadowing in CoffeeScript at all. I agree with the idea that the larger the scope of a variable the more descriptive its name should be and the small its scope the shorter its name can be.

I also don't think it's good to get carried away with closure depth, stacking them n levels deep.


I do tend to agree with the blog author that shadowing is far preferable to what CS does. I believe the fork that led to Livescript grew partly out of this concern.


I guess in theory you could do something like this:

  y = 0
  test = (x) ->
    `var y = 10`
    x + y
The language is open source... we could fix it!




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

Search: