Introduction to Haml For HTML Layouts for Newbs – Part 4: Final thoughts

Introduction to Haml For HTML Layouts for Newbs – Part 4: Final thoughts

Abstraction languages are cool

We need more of them. I only know of a few, but the ones that I do are pretty bad ass. Seems odd that the two I use were created by the same person, but if you have used Haml and Sass then you will see the connection and some of the thinking behind them.

Language abstractions make me think differently about the way I do things. Sass taught me to be a lot tighter in my CSS, and Haml showed me how you can write out an HTML page faster than lighting. In short, because of the these, I have improved as a web developer. For that alone they get my high praise and a check mark in the cool category.

Will I use Haml in the future?

Simple answer: yes. But I’ll go into the long one because this is my blog.

Even without knowing Ruby, I’m still going to use Haml. Just in the tests that I did myself I was able to breeze through an HTML page. Learning the syntax took less than twenty minutes. Haml did to HTML, what Sass did to CSS. It cut out the crap, and made coding out a page fast. I know you’re thinking that you can write out an HTML page quickly as it is. I can too. Haml just makes me faster than you now. By the time you have three divs with an id on them, I will have most of the layout written out, getting ready to add the content. I’m being totally serious when I say that. Even with having to open the command line to render it into HTML, I will blow you out of the water.

I use it in a bastardized way though. At least at the moment. I’ll create the layout in HAML, the content in Markdown, and when I’m done I’ll render it to HTML to modify that from there on out. That is not how it is supposed to be used, but it makes writing HTML so awesome I don’t care.

Should YOU use them?

Yes, because I think even knowing just one of these will help you. Writing something you think you know well in different way, makes you rethink how you were doing everything to begin with. In a good way, I promise. You’ll see the stupid mistakes you were making (and don’t even pretend you don’t make any) and how to slim it down or write it more efficiently.

I must warn you about something though. Learning Haml or Sass is like taking the red pill in the Matrix. Once you do, you can’t unlearn it. Why is that bad? Ask yourself if you like writing CSS. Did you answer yes like a good web developer? We all do, because it is cool to see what we are doing come to life on the web, or we wouldn’t be doing it. The problem I ran into is that once I really started using Sass on my freelance projects, writing CSS became a real pain in the ass.

At work, I write plain old CSS. You start writing out the styles and halfway through the stylesheet you start thinking how redundant a lot of it is. I am constantly thinking about how much clutter I could get rid of if had the use of variables, mixins, and nesting. Honestly, it is sometimes a real drag writing CSS now. That is the red pill for you. If you take the blue, CSS remains awesome. Take the red though…well, I warned you. And you won’t truly get what that means unless you try it.

So to stop my rambling on, yes, you most certainly should use them. You’ll learn something new, learn how to do the old better, and most likely save time by using them. Haml and Markdown will show you the speed, and if you combine it with Sass you’ll add the power.

Closing Arguments

If you were going to choose one language abstraction, I’ll be honest and say that I wouldn’t recommend Haml. You won’t learn as much. You will write up an HTML page very quickly, but in the end I don’t think you come away with much more than that. I would recommend Sass first. You learn a LOT about how you write your CSS, see a lot of the mistakes you make and how to correct them, and how to make your stylesheets tighter all around. Sass makes you think about what it is you are writing, where Haml is just a speed boost.

Articles in this series:

Coupon Code: webmachine

Tags: ,

Leave a Reply