25 points · by vamsee · 15y ago · 29 comments
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.
gem 'haml'
gem 'coffee'
in my Gemfile? That's cool, I just hope this stuff isn't vendored.(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
<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. :)
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.
Without it being explicitly talked about, a Rails developer wouldn't see the difference beyond "Hmm, I wonder what CoffeeScript is?"