Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by dzine on Thursday April 14, 2011 @04:16AM
(#2446047)
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.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by darklajid on Thursday April 14, 2011 @06:08AM
(#2446267)
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.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by bradleyland on Thursday April 14, 2011 @09:24AM
(#2446708)
Yes, that is all there is to it.
Whether or not it's vendored will depend upon your method of gem install. If you'd rather not have it at all, simply comment out the `gem 'coffee-script'` line before running `bundle install`.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by bad_user on Thursday April 14, 2011 @02:31AM
(#2445880)
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.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by jarin on Thursday April 14, 2011 @04:10AM
(#2446033)
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.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by jarin on Thursday April 14, 2011 @04:46AM
(#2446118)
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.
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!)
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by SpiralLab on Wednesday April 13, 2011 @11:28PM
(#2445456)
Agreed about SASS (prefer LESS, but still applies), and somewhat with CoffeeScript (I'm in the "make-it-optional-not-default-but-i-heart-CS" camp)...but 100% about HAML. It just always strikes me as backlash against HTML rather than an actual improvement.
What happens when you give HAML to a non-Rails designer? Maybe it's just taste, but I feel that true markup with template tags for data (erb) is much better than a whole new markup language for designers to learn. YMMV.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by petercooper on Wednesday April 13, 2011 @11:40PM
(#2445485)
"Backlash" is a good word. I agree (and without saying no-one else should use Haml.. people totally should if it "clicks" more with them).
I think "designers" or non-Rails people are only the tip of the iceberg though. I've been doing Ruby and Rails since 2004 and while I've tried Haml a couple of times, it never clicked with me because I already both knew and liked HTML. It felt like learning Japanese for the fun of it, yet I can already say everything I want to in English.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by epochwolf on Thursday April 14, 2011 @01:47AM
(#2445790)
Haml user here. I use haml because it allows me to see an entire page's code in a much cleaner format than erb with HTML. I can hammer out or rearrange chunks of HTML much faster in haml. To draw a comparison: haml is to HTML as yaml is to XML. Haml is denser and cleaner but it won't do everything. I still use erb and HTML for some templates because the haml just gets ugly.
Edit: a note, I am plenty comfortable writing vanilla HTML, I just prefer the speed and clarity of haml.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by jarin on Thursday April 14, 2011 @02:03AM
(#2445818)
Just a tip: most of the time, when your haml gets messy, you can clean it up dramatically by using the :textile, :markdown, or :javascript formatters (or just put regular HTML in the :erb or :plain formatters).
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by SpiralLab on Thursday April 14, 2011 @12:04AM
(#2445551)
Agreed! (IMO the ML backlash is more of a XML backlash that carried over to other MLs).
Regardless - A designer that can design for any* framework with standard CSS/HTML is more flexible than a designer that knows HAML, but could't write vanilla markup.
That why I was surprised about the Coffeescript (preferring HAML is a popular opinion, as-is Rspec: yet Erb and Test::Unit are still the defaults).
Edit: I agree that alt. languages/syntaxes in frameworks are nice. Forcing them on people is not nice.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by carbon8 on Thursday April 14, 2011 @02:59AM
(#2445932)
"A designer that can design for any framework with standard CSS/HTML is more flexible than a designer that knows HAML, but could't write vanilla markup."
This is a very bizarre statment. How can someone write haml without understanding HTML and CSS? How could that even be possible? Haml is little more than classes, ids and element names.
In my experience as a Ruby contractor I've seem many, many more WTFs in erb than haml, to the point where when I join a project using erb I now brace myself.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by swilliams on Thursday April 14, 2011 @02:49AM
(#2445908)
I tried to like Haml, but every time I've tried it on a semi-complex page it get's way too annoying. I don't think it solves the kind of problems that Sass does.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by carbon8 on Thursday April 14, 2011 @03:07AM
(#2445950)
In the years I've been using haml my experience has been exactly the opposite. Haml discourages excessive code in the template, reduces noise, makes the document structure immediately obvious and places emphasis on classes, ids, element names and attributes, making it easier to work with CSS and Javascript. As a result, its benefits become even more obvious as templates become larger and more complex.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by SupremumLimit on Thursday April 14, 2011 @03:25PM
(#2448067)
One useful piece of advice I read about HAML on HN was that it's for structure rather than for content. It gets annoying when you're trying to style words within a paragraph with italic or bold, or when you try to insert a link followed by a period. In those cases, I just use HTML, and the annoyance is gone. Otherwise, I find HAML very useful for reducing visual clutter.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by drivebyacct2 on Thursday April 14, 2011 @12:04AM
(#2445549)
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.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv...
by bdclimber14 on Thursday April 14, 2011 @02:55AM
(#2445923)
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?"
http://doihavetousecoffeescriptinrails.com/
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.
(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.
Whether or not it's vendored will depend upon your method of gem install. If you'd rather not have it at all, simply comment out the `gem 'coffee-script'` line before running `bundle install`.
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.
Not to mention the people who "left Ruby a while ago" but are somehow super passionate about this commit.
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!)
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
into 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. :)
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.
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.
Coffeescript is a language that compiles down to Javascript. Haml is a language that is interpreted into HTML.
What happens when you give HAML to a non-Rails designer? Maybe it's just taste, but I feel that true markup with template tags for data (erb) is much better than a whole new markup language for designers to learn. YMMV.
I think "designers" or non-Rails people are only the tip of the iceberg though. I've been doing Ruby and Rails since 2004 and while I've tried Haml a couple of times, it never clicked with me because I already both knew and liked HTML. It felt like learning Japanese for the fun of it, yet I can already say everything I want to in English.
Edit: a note, I am plenty comfortable writing vanilla HTML, I just prefer the speed and clarity of haml.
i.e.:
Regardless - A designer that can design for any* framework with standard CSS/HTML is more flexible than a designer that knows HAML, but could't write vanilla markup.
That why I was surprised about the Coffeescript (preferring HAML is a popular opinion, as-is Rspec: yet Erb and Test::Unit are still the defaults).
Edit: I agree that alt. languages/syntaxes in frameworks are nice. Forcing them on people is not nice.
This is a very bizarre statment. How can someone write haml without understanding HTML and CSS? How could that even be possible? Haml is little more than classes, ids and element names.
In my experience as a Ruby contractor I've seem many, many more WTFs in erb than haml, to the point where when I join a project using erb I now brace myself.
Without it being explicitly talked about, a Rails developer wouldn't see the difference beyond "Hmm, I wonder what CoffeeScript is?"