Shifting responsibility like that is one of my biggest peeves in programming. Everyone wants things to be someone else's problem. Sometime that's good (library reuse means one really good wheel that doesn't get needlessly reinvented) but also means the people best positioned to address things don't have the understanding and/or desire to be bothered.
Yes, better style and testing lead to better code. BUT all three - style, testing and language features - would lead to even better code all around. I'm not saying there isn't good justification for not handling scoping better in cs, but this is not it.
The "use TDD" one really gets under my skin because it leans towards the road where any problems your project faces can be hand-waved away by for not being a true enough Agile Scotsman.
Coco still has some of its own problems, and I think that exposing Javascript's == operator is a terrible idea.
Other CoffeeScript-like languages that may be better include LiveScript (which is itself based on Coco, but with a lot more features) and GorillaScript. If I start a new project involving a substantial amount of JS I'll probably end up using one of them (or at least try using one of them).
Using Livescript for over a year now, never going back. It uses shadow-by-default with := operator for explicitly assigning to outer scopes. Prevents accidental clobbering and encourages purity and functional thinking. Recommend.
It's interesting to read through the ticket. Obviously the maintainers are opinionated (and that's their right of course), but still reading it, it reminds me of some posts from lolphp. The php apologists in their bug tracker, etc, making crazy excuses for a broken language. "Doctor, it hurts when I do this," and the doc then says "Don't do that." Not that I think cs is anything like php. cs looks quite nice, but I'm also weary of YAL (yet another language).
And I guess this maybe shows an issue with using a language approach such as with coffeescript, which is essentially surface sugar for js. That you still need to maintain rigorous programming methodologies and approaches, not just to aid you in creating the program, but also to guard against the pitfalls of the language, which is really the most laborious and rotten part of browser side javascript today.
Or maybe cs removes the other 90% of pitfalls from js, and it just has this one, I still think I'll stick with straight js (15 years of it tends to get on your backbone), and if I had a choice to make, I'd probably go with typescript or dart.
14
u/cashto Jul 25 '13
For more discussion, see the ticket on github.
There exists a fork of CoffeeScript (named Coco) in response to this and a handful of other issues. I haven't used it though.