Ben Scofield

me. still on a blog.

On Haml

I’ve been very happy to see that, for the most part, the evangelism around Haml has died down over the past year or so – it felt like you couldn’t go anywhere in 2010 without getting slapped in the face with significant whitespace. It still crops up every once in a while, though, so I thought I’d add my ever-welcome $0.02 and explain why I don’t use it.

  1. HTML isn’t broken. Sure, it takes more keystrokes, but there are no faults in HTML that are fixed by Haml (unlike Sass, which actually does fix problems in CSS – and can I just cheer the separation of Sass into its own gem?).
  2. Significant horizontal whitespace becomes a gigantic problem when you have more than one screen of content. Even relatively simple web pages can run to multiple pages of markup, invalidating the “indentation as visible structure” argument.
  3. Haml implicitly promotes a <div>-heavy markup structure – it’s just too easy to go <div>-crazy with Haml, instead of the slimmer, more semantic markup style that I prefer.

Of course, your mileage may vary. Do what you want, but please stop accosting those of us who choose something else.

Edited: Haml isn’t an acronym, so all of my “HAML”s were incorrect. Sorry!