When comparing Haml vs Pug (previously Jade), the Slant community recommends Pug (previously Jade) for most people. In the question“What are the best HTML preprocessors?” Pug (previously Jade) is ranked 1st while Haml is ranked 4th. The most important reason people chose Pug (previously Jade) is:
Ranked in these QuestionsQuestion Ranking
Pro Easy to learn
There are plenty of learning resources available for those who want to learn Haml. The documentation is detailed and well organized, and Haml is easy to pick up.
By using indentation rather than closing tags and eliminating curly braces, Haml is fast to code.
<div id ="lower"> <div class="right column"> <div id="currentDate"><%= print_date %></div> </div> </div>
Can be written as:
%div#lower %div.right.column %div#currentDate= print_date
Pro Clean syntax
Haml's syntax is very clean and pleasant to look at. It doesn't use HTML tags and it's not verbose at all. The templates are easily readable.
Pro Clean syntax
Pro Reuse code in other langauges
Con Bad Performance
The rendering time with haml is slower than its competitors.
Con Whitespace sensitivity can be problematic
Haml uses indentation to define structure, rather than closing tags. Though this, in most cases, makes code more efficient to write, it can also cause problems.
Being off by one space can cause an error or change the structure of the code.
Con Unforgiving in case of indentation errors
The structure is entirely determined by the indentation. That means that indentation errors will ruin the end result, often without an easy way to find the error. Indentation errors are easily introduced by copy-pasting, by rearranging code and by working in a team where not everyone uses the same indentation style. (E.g tabs vs. spaces.)