Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the main differences between HAML, SASS/Compass and ERB?

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

like image 713
Yen Avatar asked May 03 '09 15:05

Yen


1 Answers

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.

like image 142
Tim Sullivan Avatar answered Sep 28 '22 06:09

Tim Sullivan