views:

534

answers:

1

I'm looking for a templating engine. What are the important factors to consider when choosing among Haml, Sass/Compass and erb?

+7  A: 

To summarize:

  • Haml is a markup language
  • Sass is a set of CSS extensions that compile into standard CSS
  • Compass is a wrapper for Sass around things like Blueprint
  • Erb is simply HTML with embedded Ruby code.

Generally, you'll be looking at Haml or Erb (though you can mix and match them if you need to), and CSS or Sass. Compass is simply an add-on to Sass.

I'd recommend starting with Haml and Sass, as Haml takes most of the annoying, bug-prone aspects of HTML and ditches them. Once you get used to writing in Haml, using Erb feels very wordy.

As for CSS, pick a framework (such as Blueprint), and use it as-is to start. You can always add Compass on later if you feel that you need it.

Tim Sullivan