Recently we asked you about ‘Your Top 3 Most Useful Ruby Gems‘ and you all voted Haml to the number 3 spot. In this brief interview, Satish Talim of RubyLearning talks to Hampton Catlin the inventor of the Haml markup language.
Satish>> Welcome Hampton and thanks for taking out time for RubyLearning. For the benefit of the readers of this blog could you please introduce yourself and tell us what you do for a living?
Hampton>> I’m a technology hobo. I write applications, sites, mobile apps, and anything I can think of. Launching, launching, launching. Also, I work with the Wikimedia Foundation as the Lead Mobile Developer and am the man behind m.wikipedia.org. Oh yeah, and I also came up with Haml years and years ago.
Satish>> How did you get started with Ruby; what’s your background?
Hampton>> I kept hearing Ruby showing up on Slashdot around 2003. I finally bucked up and learned it with the original Pickaxe. I was a fresh-faced University drop out at the time and Rails was just coming out. Back then it was Rails v Nitro and the Man wasn’t taking Ruby seriously.
I then got a job at Unspace in Toronto and worked there for 3 years where I came up with Haml and launched a ton of sites for other people. I burned out and decided to start building stuff for myself. And… it worked!
Satish>> You are the inventor of the Haml markup language. What’s Haml from the perspective of a Ruby Noob?
Hampton>> Haml is an ERB alternative. It helps you write clean, structured, clear views. It’s primarily inspired by CSS and Yaml.
Satish>> Where all can a Ruby Noob use Haml?
Hampton>> Well, first just install the gem. It doesn’t hurt anything. Then, I always recommend trying to change your application layout into Haml. It’s the one with the biggest difference as far as code quality. And just try to focus on the fact that its like CSS. I think that’s the real key to what makes it fun. “A div with the class ‘item’” is written as .item… Simple! Want something with the id “nav”… then its #nav just like in CSS.
Satish>> What’s the best way for a Ruby Noob to learn Haml?
Hampton>> Nathan Weizenbaum is the primary Haml maintainer. He has written an excellent tutorial.
Satish>> Is there any book on Haml? Do you plan to write one? If yes, to whom is the book targeted at?
Hampton>> There aren’t any books on the subject… but there was some talk of doing one a while ago. If people want it, we’re more than happy to make it happen. But, I’m not so sure that people are dying for it. I think what would be better is front end best practices for a programmer using Haml. It’s amazing to see how many programmers don’t properly structure the front end. Be friends with your CSS-ninja!
Satish>> Anything else you would like to add?
Hampton>> Haml isn’t for everyone. Not at all. When I first wrote it I wrote it for me to make sure that my views were bugfree (it complains a lot!) and structured semantically. Maybe you don’t care… and that’s fine! Maybe you like hand coding…. fine! I’m not offended. It’s not for everyone, but you should at least try to experience how it feels to code in it. That’s the most important part about a language. How do you *feel* when you are expressing your ideas into code. And, for me personally, Haml has been a total success in that respect.
Thank you Hampton. In case you have any queries and/or questions, please post your questions here (as comments to this blog post) and Hampton would be glad to answer.