
Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controversy - vamsee
http://www.rubyinside.com/rails-3-1-adopts-coffeescript-jquery-sass-and-controversy-4669.html
======
jarin
Well, bad news guys:

<http://doihavetousecoffeescriptinrails.com/>

------
dzine
I don't see why this should be controversial, it's so easy to switch to Haml,
Sass or jQuery when you need/want to. The defaults are there to get the
uninitiated off the ground as quickly as possible, and is in keeping with the
'rails way'.

I, on the other hand, have my 'own way', and rails doesn't in any way prevent
me from implementing that when I start a new rails project.

------
bradgessler
How will this be integrated? Does this just mean when I generate a rails
project, I'll see:

    
    
      gem 'haml'
      gem 'coffee'
    

in my Gemfile? That's cool, I just hope this stuff isn't vendored.

~~~
darklajid
Yes, that's about it. In fact, that's what the diff shows if you follow the
link.. :)

(no haml though). This is purely about adding a line saying

gem 'coffee-script'

That's it. Lots of 'nerdrage' in the comments though, feels like reading
4chan. Considering that more and more people like to point to Github as a
reference for their future employers I do wonder what the motivations are for
some of these comments.

------
bad_user
While I don't agree with this change, I have to hand it to DHH -- he brings
"opinionated" to breathtaking heights :)

And he's right -- these kind of changes may be controversial, but Rails was
never about being mainstream / safe / conservative. Rails was always about
being productive, and in that context taking risks is good -- which is the
reason for the dozens of Rails-clones written in dozens of languages.

~~~
jarin
It amazes me how many developers (even ones who like coffeescript) feel
compelled to rage on behalf some hypothetical developer who is capable of
learning all of the other stuff in Rails but whose head will explode the
moment he touches a .coffee file.

Not to mention the people who "left Ruby a while ago" but are somehow super
passionate about this commit.

~~~
bad_user
If you're referring to my disagreement, I disagree simply because IMHO, the
price paid for Coffeescript is not worth it. But heck, whatever.

~~~
jarin
Haha, I wouldn't really consider your post "raging" (if it was intended to be,
it needs way more hyperbole), it was a response to your comment about the
controversial nature.

------
akkartik
Why not haml? Was there a discussion about this?

~~~
petercooper
DHH finds it to be a "splinter in [his] brain":
<https://twitter.com/#!/dhh/status/58289541068492800>

Can't say I disagree with him. Sass extends CSS with extra functionality.
CoffeeScript allows complicated things to be expressed easily. But Haml is
essentially an aesthetic thing for coders who merely don't like HTML, IMHO.
(But luckily it's _so easy_ to add in and if you use the "haml" extension on
your views, it should mostly Just Work™ so it's all cool!)

~~~
_pius
_CoffeeScript allows complicated things to be expressed easily. But Haml is
essentially an aesthetic thing for coders who merely don't like HTML, IMHO._

Haml and CoffeeScript serve practically the same type of role (the greater
complexity of JS notwithstanding).

"It's just an aesthetic thing" can be used to dismiss practically anything,
even the differences between, say, Ruby and Java.

If you're writing a lot of HTML, turning

    
    
      <div class="foo">
        <div id="bar">
          <span class="baz">
            qux
          </span>
        </div>
      </div>
    

into

    
    
      .foo
        #bar
          %span.baz qux
    

is a big win. It reduces the noise in a template substantially and is a
perfect impedance match with the CSS3/JQuery selector syntax.

For what it's worth, I hated Haml until my third time playing with it. :)

~~~
prpatel
HAML is a DSL for doing HTML markup & templating, Coffeescript is a "language
extension" to JavaScript. How are they playing the same role???

~~~
bradleyland
"Is a rose by any other name still not a rose?"

I write HAML, the plugin generates HTML.

I write Coffeescript, the plugin generates Javascript.

Surely you can see how these two are similar. Yes, there are more precise
definitions for each, but pragmatically, they play a similar role.

~~~
petercooper
Except that a proficient Haml developer will still need to "think in HTML" and
Haml is just another way to express it.

CoffeeScript goes so far and introduces enough new concepts that you can
"think in CoffeeScript" and not worry about JavaScript _too much_.

You're right that the translation idea is similar but I can't agree that the
mental model for using both is similar.

------
drivebyacct2
Who cares? How much longer is this going to drag on? It doesn't force you to
use CoffeeScript, you can easily continue to write JavaScript or Sass with no
detrimental effects. If I understand correctly, it only changes the templates
created.

~~~
bdclimber14
It doesn't even change templates. I literally is one line of code in a
configuration file (the Gemfile) which most people populate with their own
settings anyway.

Without it being explicitly talked about, a Rails developer wouldn't see the
difference beyond "Hmm, I wonder what CoffeeScript is?"

