erb, haml or slim: which one do you suggest? And why?

Omid Kamangar picture Omid Kamangar · Jul 9, 2012 · Viewed 45.7k times · Source

I am learning Rails and I have seen these template engines. I have no experience with them (only erb).

But as I am a beginner, I am really confused. Which one do you suggest and why? Erb, Haml or Slim? Please tell your reason for preferring one over the others. And if you have any other recommendations, please let us know.

EDIT: I am NOT looking for a winner here. I just want to hear your opinions about them, their syntax, speed of execution, and so on.

Answer

Bart ten Brinke picture Bart ten Brinke · Jul 13, 2012

Two big advantages of using slim over haml:

  1. Slim is currently about eight times faster than haml.

  2. Slim supports HTTP streaming, while HAML doesn't.

  3. Slim has a more natural syntax: a href="foo.html"