Sunday, February 27, 2011

Why Haml?

When things are modular, simplicity and understanding have a chance to precipitate. Working with something that deals with a multitude of responsibilities is mentally tiring.

When using markup like HTML, there is a distinction between structure and layout. HTML provides the structure and CSS provides the layout. You should be able to separate out the two. The HTML should still make sense and be organized even without the CSS. This idea is very well demonstrated with CSS Zen Garden.

Inline CSS, I Banish Thee!

So where does Haml come into all of this? With Haml, I find it very hard to use inline CSS. Some may think this is a disadvantage because you can't do quick tweaks (read hacks). Hacks are usually done in the moment with the thought of fixing it up afterwards. Unfortunately, these usually end up sticking around permanently since it works and there is always something more important to do. You end up with HTML that does more than structure. With Haml, you are more inclined to let CSS handle the layout.

My Poor Fingers

Haml saves you a lot of keystrokes. It is much less verbose than HTML and ends up saving you a lot of time. With less characters required, it is easier to see the structure of the entire page at a glance, which helps once you move onto styling the page with CSS.

This Looks Familiar

Once you start converting your HTML to Haml, you'll notice something. It kind of looks like CSS! Because of this, it makes the CSS easier to write and understand.


If you have time, check out Haml and let me know what you think.

No comments:

Post a Comment