4 ms·
Really? Everyone seems to be freaking out as if Rails will no longer serve your standard JavaScript files again. Rather, by default, the generator spits out Cof
by ddagradi 16y ago
Really? Everyone seems to be freaking out as if Rails will no longer serve your standard JavaScript files again. Rather, by default, the generator spits out CoffeeScript templates. If you don't want to use CoffeeScript, don't use CoffeeScript and write regular JavaScript instead.
Will this confuse new users? Probably not, since the template file is going to include instructions and an explanation. Will the change break any existing sites? I really doubt it.
In the end, encouraging a better default language is a great change. New users are already required to learn to write ERB/Haml to make a Rails app; this is no different, and easily ignored if you're not interested.
- KarlFreeman 16y agoCouldn't agree more with you. Good points.
- icey 16y agoDon't you feel it would have been more prudent to start by bundling CoffeeScript support and then changing the default in a later version? It seems like an overly aggressive goal to do both things at once.
- jarin 16y agoOne of the core strengths of Rails is that it is highly opinionated. That's why people talk about doing things "the Rails way". You can always change things if you like (a lot of people change the views to Haml, UJS library to jQuery, and test framework to Rspec), but it assumes sensible, working defaults.
- icey 16y agoExcellent point. Not being a Rails guy I sometimes forget that being opinionated is considered one of its strengths. If any framework can get away with doing something like this, it'd be Rails. At any rate, I'm excited about anything that increases CoffeeScript adoption.
- ddagradi 16y agoI guess, but at that point, what's the point of bundling support at all? Support is as easy as adding "gem 'coffee-script'" to the Gemfile. [edit] And with SCSS also slated to be the default, it seems consistent with "the Rails way" moving forward.
- MatthewPhillips 16y agoIt's not easily ignored. If you don't want it to spit out .coffee templates and instead get .js templates, you can change that... but you have to find out how (I for one don't know how). It's an added inconvenience. The person who's an early adopter to a new language like coffeescript should be the ones inconvenienced.
- nevinera 16y agoWhen 3.1 is released, within hours a google search for 'how the hell do I make rails spit out javascript instead of coffeescript' (or 'rails js cs', most likely) will produce hundreds of results, all of which explain the one-line change necessary in excruciating detail.