Off the top of my head this is what I came up with
ERB:
Pros
- default out of the box
- not white space dependent
- lowest barrier of entry (if coming from HTML) as its HTML with Ruby code sprinkled in
- most IDE's lexers read it by default
- DHH prefers it
- legacy apps are probably still using it
Cons
- more verbose
- content_for tags in helpers and views can get out of hand quickly
- content_for tags makes nesting tags harder as erb only returns the last line in the block. so you have to append to a string and then return that.
HAML
Pros
- more concise. no closing tags, fits in smaller screens
- visually cleaner structure
- has built in helpers (haml_concat, haml_capture) to utilize haml in helper methods
- class chaining
- lots of useful syntactic sugar like # for divs or . for class chaining, or :javascript for JS tags
Cons
- whitespace dependent which makes for some hard errors to figure out at times
- complex tags usually need to resort to "hash" format. (Although I actually think this is a great example of flexibility to someone starting out it could be a pain.)
- added as a gem (again probably a stretch to put this as a con)
- designers might have some trouble adjusting
- in addition to the general whitespace warning... simple whitespace errors eg. tabs and spaces for indentation, can cause pages to err in production which normal specs/test won't catch. Moral: Expect greater need for view tests and possibly don't use haml for mission critical views, unless you're sure that your tests are testing the actual rendering of the view.
- is slower (than erb)
- caveat: this is ruby code we're talking about if speed is a blocking issue in your application there are alternatives to ruby, e.g. haskell