Sorry Haml, you won't take over the world.
This passage from Smashing Magazine surprised me:
…recent versions of Rails let you take your pick of templating languages, and nowadays the Ruby interwebs have been all abuzz about an alternative system called Haml.
While I think Haml is very interesting and well done, the big secret is that it will never be mainstream.
Why? One simple reason: HTML is easier. Now I know lots of developers will say No way! HTML is verbose, confusing and hard to read
or Haml is so much cleaner and quicker to write.
Both of these are true, but everyone already knows HTML.
Everyone. Any kid who’s edited their blog template or MySpace page knows the basics of HTML. They might not know the best-practices, but they understand it. Haml might be cleaner and easier for the programmer brain, but HTML is universal.
Markup vs. Programming
This isn’t a case of lower level languages (assembly) being replaced by higher-level languages (C, etc.), but there’s a temptation to make that comparison. C code is effectively transformed into assembly code in the same way Haml is transformed into HTML. But markup languages are not programming languages.
Let me repeat that: markup languages are not programming languages.
A markup language isn’t meant to be translated from high to low level. I’m writing this in the Textile markup language, but it’s really nothing more than macros to help me write HTML quicker. HTML is the canonical format of this post.
In the same way, Haml is effectively a set of macros. Contrast this to other templating languages (see any blog or CMS). A templating language doesn’t try to reinvent HTML, rather it helps you write more HTML by interspersing programming. In the end, it’s all HTML.
Haml is harder
Why do I think Haml won’t ever be big? Because it’s too different. While all the templating languages vary a bit, they are all readable to anyone who knows HTML. Haml is readable to Ruby users, and that’s about it.
I won’t argue that Haml is cleaner, more concise or easier to code. The problem is that HTML is universal. Your Rails team might be quicker in Haml, but you’ve made your code less maintainable to others and less readable to the masses. Most designers are going to understand HTML even if they don’t write much of it.
I don’t want to say you shouldn’t use Haml or that it is bad in any way. Just realize that there are trade-offs to using a markup language that pretends to be a programming language. You may not like HTML or angle brackets, but they’re here to stay. It’ll take a sea change to get us off HTML, not a new way to write it.
Comments
-
Hi Daniel,
What do you think of markaby?
fatcow!
-
fatcow: I feel the same way about markaby. I love the concept, but I think its solving the wrong problem, and the bulk of the world will never understand it.
Use it if it works for you, but I can’t recommend it for most people.