Live data from Hacker News

I Hate Haml

ithaca.arpinum.org

31–37 of 37 posts

Re: I Hate Haml

#31

Haml is great for structure, not for content. Chris Eppstein wrote a great post on this that worth reading: http://chriseppstein.github.com/blog/2010/02/08/haml-sucks-f...

That's absolutely correct. I think too many people have a misconception of what haml is good for.

Personally, I use haml for all my rails view layouts. Anything more complicated than a wrapper div gets rendered in a separate .erb partial. This makes it very easy to shuffle around different parts of the layout when needed.

Re: I Hate Haml

#32

Earlier quoted context omitted.

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

Yes, HAML is directly tied to Ruby. Although there are PHP ports out there in progress. There is also a Ruby Discount gem, rdiscount.

A few Python versions, too (two projects that call themselves pyhaml).

Re: I Hate Haml

#33

Haml is great for structure, not for content. Chris Eppstein wrote a great post on this that worth reading: http://chriseppstein.github.com/blog/2010/02/08/haml-sucks-f...

That makes a lot of sense, and neatly explains why I so strongly prefer Markdown. Thanks for posting this.

Re: I Hate Haml

#34
post #30

Earlier quoted context omitted.

As someone who uses HAML constantly: 1. :markdown doesn't accept classes, ids, or any other modifiers like %tags. This makes for some difficult fugging. 2. You cant do - ruby or = ruby under :markdown or similar. This is terribly inconsistent and requires some stupid work arounds.

1. Discount, used by both RDiscount and BlueCloth, supports limited use of classes in inline text via pseudo-protocols in link-style tags. You can also use inline HTML in markdown. I believe that the latter is what most people do. 2. You can do the equivalent of = in Haml filters by enclosing the Ruby in #{}. For example, where sign_up_path is a Ruby helper method: :markdown [Sign Up](#{sign_up_path}) Personally, in…

The :markdown "symbol" doesn't take a class.

    :markdown.red#item2

    %list:markdown.red#item2

    %list.red#item2:markdown
...

Re: I Hate Haml

#35
post #30

Earlier quoted context omitted.

1. Discount, used by both RDiscount and BlueCloth, supports limited use of classes in inline text via pseudo-protocols in link-style tags. You can also use inline HTML in markdown. I believe that the latter is what most people do. 2. You can do the equivalent of = in Haml filters by enclosing the Ruby in #{}. For example, where sign_up_path is a Ruby helper method: :markdown [Sign Up](#{sign_up_path}) Personally, in…

The :markdown "symbol" doesn't take a class. :markdown.red#item2 %list:markdown.red#item2 %list.red#item2:markdown ...

Forgive me if I'm misunderstanding your point, but :markdown isn't a tag that gets output to html, it just designates the beginning of the block to be processed with markdown, so classes and ids aren't applicable. If you want the markdown block in a class or id, you just do this:

    #id.class
      :markdown
        [A link](/path)
outputs:

    
      A link
    

Re: I Hate Haml

#36
post #23
post #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).

I resisted haml for a long time because of this; "HTML is good enough, why change it?" and then I found out that it's really, really useful. I'm currently dual-maintaining a theme in Wordpress and a Rails app; the former is PHP with your standard interpolated HTML, and the latter is haml. Guess which one is harder to maintain? (Hint: It's the Wordpress theme, by about three hundred miles).

I personally found HTML + PHP a pain after playing django and it's template model found it removed most of the pain that I was encountering.
Post reply on HN