Hacker News new | ask | show | jobs
by crazygringo 4887 days ago
I've never heard of HAML before. From the website, is it literally just "markup should be beautiful"?

I mean, LESS/SASS add real functionality. Even CoffeeScript adds functionality to JavaScript, beyond just changing the syntax. But is there any functional advantage to use HAML? Is it actually worth half a chapter of an "advanced guide to HTML & CSS"?

(Totally my opinion, but it doesn't even look clearer or "more beautiful" to me, but maybe that's just because I'm used to HTML.)

3 comments

Oh, come on. You got hung up on an adjective used in a hero unit.

http://haml.info/docs/yardoc/file.REFERENCE.html

Filters, passing Ruby objects into it to generate classes, hell, even markup comments that don't show up in html.

I was a little surprised to see so much dedicated to HAML in an HTML/CSS tutorial. The author's background is as an instructor at the starter league which is heavy on Rails. HAML is widely used in that community so his perspective might be slightly bias.

But it is still useful to know and see there are other ways to handle to write HTML.

And that is because it is more than "markup should be beautiful". I cringe when that is stated as the only reason. Markup that is simplified can lead to easier readability and fewer mistakes. It removes the worry if you forgot to close a tag and removes them all together.

I was hesitant at first after being so used to working with HTML but I am happy as ever after making the switch. I find my time is more productive and updating the html is much quicker.

I've used HAML for 4 years now, my take on it is that HAML gets the computer to do work it can dependably do (writing out closing tags) and reducing substantially how much I have to type. Less typing means less code to maintain but also easier to see the purpose of the code.