Live data from Hacker News

I Hate Haml

ithaca.arpinum.org

1–10 of 37 posts

Re: I Hate Haml

#2
I don't hate Haml, but I think HTML is ok as HTML, especially for those cases where I want someone who is not a developer to work on a template.

Re: I Hate Haml

#3
I've wondered if haml is just a reaction to I don't like XML mindset, so we'll invent a new syntax. Personally I like SASS, since it needed hierarchy defined. But cleanly written HTML gives you that (yes, you need close tags, but I already write closing parenthesis).

Re: I Hate Haml

#4
The OP does know that HAML supports straight HTML as well right? The following is perfectly valid:

%h2 Heading content

%p This is just some emphatic text. Maybe I'll talk about $BASH_VERSION here.

Personally I'll never go back to writing straight HTML ever again. It's ridiculously verbose, uses characters that are very hard to type, and it's easy to forget to close a tag and not realize it.

Re: I Hate Haml

#5
Haml hits the wrong points for me as well:

- Too much syntax for a pure writing markup languages, compared to Markdown or Wiki syntaxes

- Too little syntax compared to even syntax light languages like JSON or [HT|X]ML (when written with zen coding or a tag matching editor)

It's just kind of awkward. Useful when embedded into rails, but not as a general use markup language.

Re: I Hate Haml

#6
In which the OP can't figure something out so they choose to flame it instead.

The OP provides the following example as a irrefutable damnation of haml:

%h2 Heading content

%p This is just some

  %em emphatic

  text. Maybe I'll talk about

  %code $BASH_VERSION

  here.


They complain about the inability to nest em and code tags on a single line.

Hey OP, try this:

%h2 Heading content

%p This is just some emphatic text. Maybe I'll talk about $BASH_VERSION here.

or did you forget that you can mix html in with haml where needed? Pointless, sloppy, flame-bait. /endrant

I was reluctant to learn HAML myself, but after being "forced" to do so on a project last spring, I actually cringe when I see standard HTML and CSS now. Not only has haml shrunk the size of my code by almost half, it has made it easier to scan, maintain, and my css matches up much more closely to my markup. Simply put, HAML/SASS is one of the biggest productivity/sanity boosts I've experienced in my young development career.

*edit: spelling, and formatting.

Re: I Hate Haml

#7
Haml isn't really for what the author of this article was doing -- writing actual prose. He has it right in the first paragraph: something like Markdown is great for that sort of thing.

For displaying structured data, as one might do in a view in a web application, Haml shines. Just think about table code.

Nobody with sense has ever said Haml is a great replacement for HTML in all cases. But it's useful and (arguably) more pleasant to use within its domain.

Re: I Hate Haml

#8
I don’t use Haml myself, but I have read that this is not how you are supposed to write long text in it. The recommended way to write paragraphs with a lot of tags is to use a filter, like Markdown or Textile. This is a better way to write the sample paragraph in the article, using Markdown:

  %h2 Heading content
  %p
    :markdown
      This is just some *emphatic* text. Maybe I'll talk about `$BASH_VERSION` here.
Note that Markdown allows you to embed normal HTML tags within itself, in case it doesn’t provide syntax for the tag you want. I’m not sure what the Haml stance is on that practice.

Re: I Hate Haml

#9

In which the OP can't figure something out so they choose to flame it instead. The OP provides the following example as a irrefutable damnation of haml: %h2 Heading content %p This is just some %em emphatic text. Maybe I'll talk about %code $BASH_VERSION here. They complain about the inability to nest em and code tags on a single line. Hey OP, try this: %h2 Heading content %p This is just some emphatic text. Maybe I'…

He's explicitly asking if there's a better way to do that (read the last paragraph), so lighten up.

PS - You spelled "flame-bait" wrong.

Re: I Hate Haml

#10
post #5

Haml hits the wrong points for me as well: - Too much syntax for a pure writing markup languages, compared to Markdown or Wiki syntaxes - Too little syntax compared to even syntax light languages like JSON or [HT|X]ML (when written with zen coding or a tag matching editor) It's just kind of awkward. Useful when embedded into rails, but not as a general use markup language.

Re: your first point, it's not a standalone markup language, it's a 1-to-1 replacement for HTML. Markdown is transformed into HTML, but doesn't have to be -- you could PDF it instead, for instance. It's mostly just a way to use structure to eliminate line noise.
Post reply on HN