5 ms·
This article "CoffeeScript's Scoping is Madness[1]" and the reddit programming discussion thread[2] convinced me to scratch CoffeeScript off the list of languag
by michaelwww 13y ago
This article "CoffeeScript's Scoping is Madness[1]" and the reddit programming discussion thread[2] convinced me to scratch CoffeeScript off the list of languages to consider. Ain't nobody got time for that.
[1] http://donatstudios.com/CoffeeScript-Madness http://donatstudios.com/CoffeeScript-Madness
[2] http://www.reddit.com/r/programming/comments/1j1cw7/coffeescripts_scoping_is_madness/ http://www.reddit.com/r/programming/comments/1j1cw7/coffeesc...
- calibraxis 13y agoPersonally, even if I conceded Coffeescript is worse in some scenarios [1], I still evaluate Coffeescript as far preferable to Javascript overall. There's multiple dimensions to consider. (Disclaimer: I've only compared the two on the backend, so far.) [1] Like representing datastructures. Or that subclass-without-constructor subtlety (https://github.com/jashkenas/coffee-script/issues/2956 https://github.com/jashkenas/coffee-script/issues/2956).
- michaelwww 13y agoI don't see that the less verbose syntax of CoffeeScript buys you that much and it's another level of indirection to worry about. My problems with JavaScript are that you're flying blind when you could have an editor pointing mistakes and making helpful suggestions. I tried Dart as a replacement first (too far removed from the JavaScript) and settled on TypeScript, which is a dream because it provides the help I want without obfuscating the resulting JavaScript at all.
- virtualwhys 13y agoCoffee buys me sanity, can easily parse it vs. the giant syntactic mess that is JavaScript. Coffee is to JavaScript as Scala is to Java. Compilation blazes with GruntJS as well so overall it's a complete and utter win [for me].
- happy_dino 13y ago> Coffee is to JavaScript as Scala is to Java. Considering how incredibly wrong and broken CoffeeScript's scoping is (at least the JavaScript designers realized that they messed up badly), I'd consider that an insult for Scala. :-)
- plorkyeran 13y agoCoffeeScript and Javascript aren't your only options. I quite like CoffeeScript on the whole, but I'm still planning to look into using LiveScript or GorillaScript for the next substantial JS-based project I work on, since they both capture what I like about CS while appearing to fix some of the issues.
- mambodog 13y agoI'd have to say it's your loss, it's a shame to discount a programming language simply based on a blog post. I remember plenty of blog posts about Go popping up a few years claiming that it was unusable due to the lack of generics, mainly stemming from on a lack of familiarity with the language. The main reason to use Coffeescript is in place of Javascript, which already has plenty of warts to avoid, many more serious that this issue, and many of which Coffeescript helps to alleviate. If time spent on something is important to you, Coffeescript can help save a great deal through it's expressiveness, especially in areas where vanilla JS is awkward (eg. OOP). Personally, with relation to the scoping issue, I tend towards using Underscore's higher-order iteration functions (each, map, reduce, etc.) in most cases instead of Coffeescript's `for`, which eliminates this issue entirely due to the scoping of the anonymous functions passed to them.
- mattdeboard 13y agoIn my experience, most people who dismiss/hate on CoffeeScript have never tried it. I've personally never met a person who has used the language at length and walked away hating it.
- crazygringo 13y agoSee my root comment. I used it for a whole year, and it would drive me nuts every day. I would never use it again. But then again, you've never personally met me, so maybe I don't count :)
- epidemian 13y agoI have know one or two people that dismissed CoffeeScript after fiddling with it for a while; but they were people who didn't have previous experience with JavaScript, and i suspect that might be part of the reason. The people i've known who most embraced CS were people who have had their deal of JS experience, who knew many of JS quirks and its workarounds, like doing "var self = this", or how to use closure visibility to avoid the need for global variables, or even how to up a prototype chain to implement some basic inheritance. Personally, i know that whenever i have to code in JS for whatever reason and need to do some of those things, i miss CS :)