Getting Our Mustache's Out
Posted 28 Mar 2011
We're going a step further in our technological advancements. Not content with the craziness we explained previously with node.js, we thought we'd have a bash with some other fun technologies that are in the limelight at present.
Mustache hasn't just caught our eye with it's simple ace logo, or the fact that our creative director is sporting a mighty fine one himself (he's the one on the left), it allows templating in pretty much any text-based file you can imagine. It's a logic-less templating mark-up, meaning no if's/else's/while's/what-have-you's, great for front end dev's who aren't so keen on learning programmery jiggery pokery.
Haml is a similar kettle of fish, some might even say a contender to the 'tache. The first line of their site under What is it? pretty much sums it up: "Haml takes your gross, ugly templates and replaces them with veritable Haiku". Although it's premise is on markup being beautiful, it also takes a lot of the error-prone fundamentals out of HTML (closing tags being the most poignant). Ace.
So why are we talking about both of these things? Surely we should become fan-boys of one before we hoot our traps off? Well Chris Wanstrath made this blog post which made us think. By using a mongodb record as the hash of data coming through, combined with Mustache populating the template, and Haml providing minimal, tidy, and 'beautiful' markup, everything could be bang-tidy. Could be. Maybe we're jumping through too many hoops with no-one watching.
On a different note, we've also been perusing the Sass project, from the same people as Haml. It's an extension of CSS3, which adds a lot of functionality which we've been dying to use; nested rules, variables, mixins.. There are two 'flavours' of Sass; scss - adding the markup to already valid CSS3 files (our favourite), and sass - adding a more rigid markup, much like Haml's. There are a number of parsers available for different languages (of which we've tried playing with PHamlP for our PHP sites, and a combination of sass.js and haml.js for our node.js work).
We've got a little internal project that we're going to be mashing all of these technologies into over the next couple of weeks. Our techical director will be keeping you in the know via our blog, Twitter, and any other social networking tool he can get his greasy hands on.
If you're interested in new open source technologies and you're not already tuned in to The Change Log, we'd highly recommend it!