News for hackers. Stuff that matters.
Re:Thank you, Rails by tptacek on Friday November 06, 2009 @12:42PM (#926461)
Because most of the day-to-day things you do in jQuery involve doing something special with an element by id or class, and Haml's syntax for special classes and id's is painless. For instance:

  %a.post_link.confirm_link.destructive_link{link_to(@x)}  
    Hi mom
I'm probably not selling it very well. But basically, you know the old DOM tutorials that talk about how you can do you own tags like:

  <box name="foo">
    <item number="1" />
    <item number="2" />
  </box>
and then convert it to

  <div class="box" id="foo">
    <div clas="item" id="item_1" />
    <div clas="item" id="item_2" />
  </div>
or whatever; in Haml, that's just:

  .box#foo
    .item#item_1
    .item#item_2
Re:Thank you, Rails by marknutter on Friday November 06, 2009 @02:28PM (#926706)
In some ways I can really see the readability gains - haml is very succinct and neat. But there's a cost involved, namely getting my eyes and brain to comfortably recognize new syntax and patterns, something that for me usually takes a long time.

I also worry about creating something in HAML and having people not familiar with it not be able to dive into the project and start working right away. I'm actually on the other side of that scenario right now and it's a pain.

But I do have to admit, it's a very pleasing syntax.

Re:Thank you, Rails by tptacek on Friday November 06, 2009 @02:50PM (#926775)
It's not even readability that makes it a win; it's that the combination of jQ and Haml is like working in a markup language that has native support for every widget or UI flourish you could want.
Re:Thank you, Rails by marknutter on Friday November 06, 2009 @04:51PM (#927022)
Very intriguing. Hmm.