Hacker News new | ask | show | jobs
by SpiralLab 5541 days ago
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.

1 comments

"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.

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.

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).
I did not know of the :erb/:plain formatters, thanks for the suggestion.
You can even use string interpolation in them :)

i.e.:

  :textile
    Hi, my name is *#{@user.name}*!
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.

"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.