5 ms·
Haml Sucks for Content
- raganwald 17y agoterrible title, this post actually explains how to use Haml the plugin to generate all sorts of content using its existing features like filters properly. The confusion is that "Haml" refers to Haml the plug-in as well as Haml the syntax for generating HTML. The syntax is not ideal for content, and that's why it supports things like inline HTML and markdown filters, just as the outline explains.
- grandalf 17y agoThe title is in the reddit linkbait genre that is becoming increasingly common on HN.
- tptacek 17y agoChris Eppstein isn't writing Reddit linkbait. He's the author of Compass, which shrunk my huge Rails app's templating code by at least 30% and massively, epically improved our stylesheets, allowing us to standardize a sprawling rusty UI on a sane Blueprint grid inside of a week. I don't like his title either, but he gets to write whatever he wants about Haml.
- grandalf 17y agoI stand corrected.
- chriseppstein 17y agoI disagree. I should be held to the same standards as everyone else.
- raganwald 17y agoOn Twitter, someone gave an alternate explanation that I'll pass along without agreeing or disagreeing. They suggested the title was a honeytrap to get Haml haters to read the post and then be surreptitiously educated on why that argument against Haml is invalid. Update... That was Chris' explanation!
- grandalf 17y agoI stand corrected.
- twism 17y agoWell I got caught in that honeytrap, so the title does work.
- chriseppstein 17y agoThat's true, but it's also a play on words. Haml (the syntax) sucks for content. This is a fact. Haml (the project) provides ample facilities for working around the syntactic limitations.
- dazmax 17y agoThe article could be replaced by the sentence: "Make sure you know about filters before using haml for content." Filters aren't a "workaround," they are the part of the language for handling content. http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#filters http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#fi...
- chriseppstein 17y agoJust because they're officially supported, doesn't mean they aren't there to work around the syntax's obvious limitations. I've been tracking Haml's development for a very long time I the history of many of these features is a result of users' frustration with the syntax.
- marstall 17y agothe 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.
- mhartl 17y agoAs an experienced and enthusiastic Haml user, I find that this matches my experience exactly. If you're a Haml-hater, please read this post.