Thursday, August 25, 2011

To Haml or not to Haml

I think I'm going to be standing quite alone when I say that I'm not much of a fan of Haml.

I've been in a but of a technology rut recently, with PHP, so I've been looking for new things.  In the past couple of weeks I've found Sass (via Compass), HTML5 and Apache Solr.

While Sass is awesome, and Haml seems to be a similar thing, but with HTML and Ruby (you can get PHP versions of Haml), I'm a little unconvinced that it's right for me.

I guess, playing with CakePHP, I'm finding it hard to see how that's going to flow nicely.  CakePHP splits files up in to layouts and views.  I haven't looked at Ruby as much as I should, but think Ruby may have done something similar.  Then, you'd normally use CakePHP Helpers, and specifically, the Html helper to generate form tags to assist with the auto magic of creating the right name attribute values to populate $this->data on the way back in.  Perhaps that's were Ruby on Rails and CakePHP differ.  Perhaps Rails doesn't have, need or use helpers and special name values for population in the controller.  That's one of the things I'm not a fan of, anyway. [Update: Here's an example of Haml and CakePHP in action.  It's a 4 year old reference, and I'm  only just hearing about Haml now. I guess Haml is perhaps just starting to reach critical mass.]

The next thing is the indenting style.  It might work for some, and I've know Python practitioners who sing its praises, but the indenting thing doesn't flow nicely in my eyes.  Sure, I indent my code, but I'm always looking out for { and } or similar constructs to tell me when the block starts and when the block ends.  You might also guess that I prefer the .scss style when I use Sass, because of the available blocks, and that is looks closest to natural CSS.

And lastly, well, I can't help but compare it to Smarty.  For a while, I thought Smarty would be my saviour for a template language.  You still have HTML, and a Smarty specific template language that "should" be easy for programmers and designers to learn, should they take the time to do so.  But that's the assumption that breaks the camels back.

The designers I work with aren't interested in working with a template language.  They're not even all that interested in cutting HTML or CSS.  They come up with an information architecture, website layouts, navigation and all the detail ends up getting captured in a Photoshop file.  Then I take that file, pull it a part, and turn it into HTML, CSS and whatever Javascript is necessary for the moving parts that a static Photoshop file doesn't capture.

So Haml ends up being another template language primarily used by programmers, not designers.

Though if you're a designer, and you're using Haml, then hats off to you.  Because you've probably had to learn about the language that hosting Haml (probably Ruby, maybe something else), controllers and views.  Here's hoping you didn't have to mess with models or complex business logic, because even just having to learn a programming language, and Haml, just to produce HTML is going beyond the call of duty.

At least Sass makes sense.  You can take a .css file, rename it to .scss and have it successfully parsed.  And then you can go to town and simply that .scss to make it easier to read.  I'm not sure you can do that with Haml.

Anyway, tune in, in a years time, when I've taken up Haml just the confuse the next person who has the maintain the HTML after me.

Wednesday, August 24, 2011


Sometime in your life you may have experiences a feeling of vertigo, a sinking pit in your stomach, a fear filled with dread, accompanied by the phase "Oh gods, what have I done?".

Well, I'm getting married this coming Saturday, and there's no place for those kinds of thoughts this week, or next week, and any other time soon after that.

Caught up in that hustle and bustle of wedding preparations (which has been done most admirably by Annika) is the acceptance of other stuff that you'd normally take a step back and appraise with a discerning eye.  On of those things in the challenge of Up; a push up competition for the amateur.

From the 20th of October, 2011, I'll be doing push ups on a daily basis, until I hit an achieved goal of 10507.  I'm estimating this will take about 4 months to complete, if I keep at it every day.

If you'd like to join, or even observe, there's the public Facebook event and the #10507 hash tag.