6 ms·
the only thing it's really ideal for is software engineers writing their own HTML. in professional team environments in my experience designers always like to b
by marstall 17y ago
the only thing it's really ideal for is software engineers writing their own HTML. in professional team environments in my experience designers always like to be able to at least dip in to HTML, and as "illogical" as this might seem to a programmer, they are never going to learn something like HAML - it's just too complex and programmery.
- Nwallins 17y agoFTA: Inline your HTML: That’s right. Just put some HTML into your Haml document. Don’t be afraid, it’ll be just fine.
- tptacek 17y agoAnd that's a red herring, because unless you keep a designer on staff, in real systems designer markup never hits the wires. Even pure HTML still gets broken up into templates and partials. Software developers may not have to design their own HTML, but they sure as hell have to write it.
- coderdude 17y agoI'm half programmer, half Web developer. I'm great at both (I don't mind saying). Being from both worlds, I don't get the need for HAML. HTML is so easy as it is. From my point of view, any programmer who can't write HTML with proficiency is deficient somehow.
- jrockway 17y ago<html><is><redundant></redundant></is></html> Whereas HAML is not
- tptacek 17y agoWow. You definitely are half a programmer! Burned! HTML is a huge pain in the ass to write: * It requires balancing tags * It's verbose * It is crudded up with syntax (</-="") and keywords * It consistently runs right off the 80 column right margin * It's an enormous pain to extend * It's slow to read; for instance, try picking the plural version of a constantly-used class name out of tag soup Haml isn't a shortcut to writing HTML. On the contrary, to use it well, you have to know HTML well. What Haml does is to solve the problems that make HTML a pain to use to express user interface in.
- coderdude 17y agoI guess I set myself up? You make some good points about why HTML is a pain in the ass. I'm just desensitized to it to the point that it doesn't bother me anymore. In fact, I didn't even think of the issues you brought up.
- tptacek 17y agoI was once like you. What it took for me was writing a UI in Haml with very minimal, semantic markup and all the controls keyed in jQ off classes and IDs. When you structure your HTML, CSS, and Javascript correctly, Haml is absolutely gorgeous. You're no longer writing in HTML: you're writing in a DSL designed to express user interface. For instance, a "save" button encoded in a DIV in Haml: .button#save That's it.
- coderdude 17y agoDoes Haml allow you to control how the actual markup is produced? Some browsers are dependent on a lack of whitespace between nodes in order to render properly without adding some extra padding (IE for instance). For me, the main issue is control over my markup. Exact and precise control, which is necessary.
- chriseppstein 17y agoYou can use the alligator operators to trim surrounding and internal whitespace. E.g. .foo> This has no whitespace outside the foo div. .foo< This has no whitespace just inside the foo div. .foo>< This has no whitespace outside or inside. http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#whitespace_removal__and_ http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#wh...
- coderdude 17y agoIncredible, they even thought of that. I guess Haml isn't so bad after all. Time to check it out.
- retro 17y agoI agree that the problems HAML creates for collaboration between programmers and designers - who, as you say will never learn HAML - is the key limitation of HAML - a limitation also discussed by James Britt in his excellent post on the topic: http://www.jamesbritt.com/2009/4/29/thoughts-on-haml http://www.jamesbritt.com/2009/4/29/thoughts-on-haml.