Live data from Hacker News

I Hate Haml

ithaca.arpinum.org

11–20 of 37 posts

Re: I Hate Haml

#11

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.

He titled it "I Hate Haml." There are better ways to ask for help.

PS - Pointing out my misspelling of "flame-bait" is flame-bait.

Re: I Hate Haml

#13
I don't "like" it either, but I don't think it sucks technically. A lot of people find it useful and there's clearly value in the abstraction.

Where it fails for me is that I don't (rightly or wrongly) see (or treat) HTML as a tightly structured language. Whereas tight formatting is beneficial for languages with minimal syntax, like CSS, in HTML I appreciate the flexibility of putting spacing and elements where I like or where I feel it makes sense (but I love SASS/SCSS as it merely enhances an already tightly structured language). As ever, different strokes for different folks.

Re: I Hate Haml

#15
This article should be titled "I don't understand Haml".

Simple tags for ya buddy:

:plain

:textile

:javascript

Re: I Hate Haml

#16

Earlier quoted context omitted.

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.

He titled it "I Hate Haml." There are better ways to ask for help. PS - Pointing out my misspelling of "flame-bait" is flame-bait.

Indeed.

So hey, to make something of this discussion: Am I correct in thinking HAML is fairly closely tied to Ruby? I'm quite familiar with Markdown* , but don't use Ruby. As long as we're committing to a given language for an ersatz HTML syntax, I prefer CL-WHO (http://weitz.de/cl-who/) or a similar approach in Lua, JSON, etc.

Also, it doesn't look like there's cross-language support, which is a major advantage for Markdown, JSON, and other such formats.

* My favorite implementation is discount (http://www.pell.portland.or.us/~orc/Code/discount/), which is written in C, quite fast, and has a good test suite and pretty clean API.

Re: I Hate Haml

#17
Another complaint I have with HAML is its treatment of whitespace. Consider:

    %p
        %span.underlinedText this is underlined
    \.
 
 
This will underline " this is underlined ", with the spaces, which looks messy. You can extrapolate this behavior to even messier cases, but you get my point. HAML's solution is:

    %p
        %span.underlinedText>
Fun, right? However, I still consider HAML to be a beautiful replacement for raw HTML.

Re: I Hate Haml

#18
Haml's great for outlining the structure of a document. For static pages with lots of em's strong's and such it's better to use something like markdown. Luckily you can easily embed markdown inside HAML. Just mark off a block with :markdown and you're done, you can put markdown in your HAML now.

No one language can give you everything, but haml's the best I've found AND it makes it easier to mark certain areas as :plain, :erb, or :markdown or whatever custom filter you dream up. So, it lets you switch more easily than any other language when you need to.

Re: I Hate Haml

#19
You can use this if you prefer to use html for some stuff:

==

This is just someemphatic text. Maybe I'll talk about $BASH_VERSION

Also exist 'plain' tag: :plain html stuff here another line easy :)

Re: I Hate Haml

#20

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'…

In addition, you can use something like the markdown filter for body text.

    :markdown
      ## Heading Content
      
      This is just some *emphatic* text. Maybe I'll talk about `$BASH_VERSION` here.
Post reply on HN