News for hackers. Stuff that matters.
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv... by _pius on Thursday April 14, 2011 @01:56AM (#2445805)
CoffeeScript allows complicated things to be expressed easily. But Haml is essentially an aesthetic thing for coders who merely don't like HTML, IMHO.

Haml and CoffeeScript serve practically the same type of role (the greater complexity of JS notwithstanding).

"It's just an aesthetic thing" can be used to dismiss practically anything, even the differences between, say, Ruby and Java.

If you're writing a lot of HTML, turning

  <div class="foo">
    <div id="bar">
      <span class="baz">
        qux
      </span>
    </div>
  </div>
into

  .foo
    #bar
      %span.baz qux
is a big win. It reduces the noise in a template substantially and is a perfect impedance match with the CSS3/JQuery selector syntax.

For what it's worth, I hated Haml until my third time playing with it. :)

Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv... by prpatel on Thursday April 14, 2011 @02:37AM (#2445891)
HAML is a DSL for doing HTML markup & templating, Coffeescript is a "language extension" to JavaScript. How are they playing the same role???
Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv... by bradleyland on Thursday April 14, 2011 @09:27AM (#2446717)
"Is a rose by any other name still not a rose?"

I write HAML, the plugin generates HTML.

I write Coffeescript, the plugin generates Javascript.

Surely you can see how these two are similar. Yes, there are more precise definitions for each, but pragmatically, they play a similar role.

Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv... by petercooper on Thursday April 14, 2011 @06:40PM (#2448742)
Except that a proficient Haml developer will still need to "think in HTML" and Haml is just another way to express it.

CoffeeScript goes so far and introduces enough new concepts that you can "think in CoffeeScript" and not worry about JavaScript too much.

You're right that the translation idea is similar but I can't agree that the mental model for using both is similar.

Re:Rails 3.1 Adopts CoffeeScript, jQuery, Sass and.. Controv... by _pius on Thursday April 14, 2011 @10:43AM (#2446986)
Coffeescript isn't a "language extension" to JavaScript.

Coffeescript is a language that compiles down to Javascript. Haml is a language that is interpreted into HTML.