Private members in CoffeeScript

1 · Evan Hahn · Aug. 15, 2012, 5 a.m.
In short: stick to the JavaScript convention of prefixing private members with _ because private members don't work very well. CoffeeScript can implement private functions, but not other variables. It's a big can of worms and is only elegant in very simple cases. I'll warn you: this gets hairy, and I'd recommend using the JavaScript convention of prefixing private members with _ and calling it a day. Simple functions In simple cases for functions, it works very well. Take a look at the example b...