5 ms·
Interesting, but I really do not like the implied HTML tags (+ blocking via indentation) going on there. Mentally parsing HTML isn't that bad for someone with
by walkon 14y ago
Interesting, but I really do not like the implied HTML tags (+ blocking via indentation) going on there. Mentally parsing HTML isn't that bad for someone with a bit of experience. This would add a new wrinkle (i.e. friction) to design.
- whalesalad 14y agoI've been hand coding HTML for years. Switching to HAML was a no brainer. We already write indented HTML, why worry about extra angle bracket syntax and closing tags? I'm surprised by the number of people who don't like using technology for what it was invented to do: make your life easier.
- walkon 14y agoI'm surprised by the number of people who don't like using technology for what it was invented to do: make your life easier. That's my point - I don't see this being much easier or particularly valuable, considering I will always have to be highly competent with straight HTML regardless. To me, this is a mental switch with little payoff (handlebars + HTML is fine).
- machty 14y agoThis is a JavaScript templating language; aside from the fact that I like Emblem's syntax way better, you can't use HAML for JavaScript templates unless you go the hacky/ugly hamlbars route.
- vidarh 14y agoSeeing as you can obviously use technology to not worry about extra angle bracket syntax and closing tags, I don't see why you need to hide them in order to achieve that. I'm surprised by the number of people who want to strip out visual cues like that. To me, that makes life harder.
- danneu 14y agoSome people like different things than the things you like. I like `abstractions` instead of `tools that let me coexist with clunky things`.
- whalesalad 14y agoPrecisely. The abstraction removes human error. Coffeescript is a great example: it lets me forget about extra commas in an array, or semicolons. Jquery is another: it lets me forget about the inconsistencies between certain browsers with, for example, Ajax.
- machty 14y agoIndentation languages in general are a step up from editing raw HTML; by the time people are ready for another abstraction, the common tags will be far more ingrained in their heads. Syntax highlighting helps, too (existing solutions for the Slim templating language are already pretty good for Emblem, even coloring unrecognized html tags). And last but not least, you can optionally prefix your html tags with % to be explicit, and prefix dynamic "mustache" content with =.
- FuzzyDunlop 14y agoI agree, and it's also the reason I dislike HAML and all the other things that want to use significant whitespace. Writing plain old HTML is fucking simple. Abstracting it out into another 'language' just means you have to deal with a whole load of quirks and workarounds you'd never see with HTML, and while it looks all purdy and shit to some, it's an absolute nightmare to maintain. Want to nest elements? Either you can't, some syntax has been introduced to discourage it (the end of line pipe), or you're told to just... use plain HTML. Want to interpolate variables? That's probably built in, which is great until you try changing it back to plain HTML, and then have to scan for all the interpolation, which is now plain text. There's likely so much focus placed on "one-lining" everything that you have to do silly things just to actually make the template readable, when it wouldn't be a problem in HTML. Never mind the total lack of portability and, especially these days, requiring a copy of Node just to run the damn things. Which is fine until you realise you shouldn't need to add a full on javascript VM to your development dependencies. That so many of these attempts at 'HTML templating languages' exist is probably testament to the fact that no one agrees on what one should look like. They've actually been staring it in the face all along: plain old HTML.
- jwdunne 14y agoYes, I agree here. I've written a fair whack of plain HTML, whilst having used some preprocessors before, so I have some thoughts. Writing plain HTML purely by hand is a pain. A massive pain. Don't do it. If you're writing HTML by hand, you're writing well over half of what you should be writing. There are tools out there that help, my number one favourite being ZEN coding. ZEN coding is a set of tools, namely an abbreviation engine, for writing and manipulating HTML. The abbreviation engine allows you to write CSS selectors in place that ZEN will expand for you, which alone is extremely powerful. For example, the if we want 2 unordered lists of 4 links, we can write: ul*2>li*4>a This would be expanded to: <ul> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> </ul> <ul> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> <li><a href=""></a></li> </ul> ZEN further provides hotkeys for navigating the blank spaces in this generated code where I'd likely want to fill something in. This is just the start though, it really comes into its own when you realise the power of Wrap abbreviation. ZEN coding dramatically increases the rate I can write HTML and it did this within a couple of days. I remember when me and a colleague would receive a Word doc which had to be completely marked up. My colleague would take it up using a hacked together solution - he wasn't a very good programmer but had more HTML/CSS experience than me. This would take him around 2 hours to complete (70+ page doc). When he left, it was down to me. I completed it in the same amount of time using just ZEN coding (I'm not crazy though, I did write a better tool which cut that job down to 5 mins). I advocate it so much I demand any new starter to learn it as a priority - the difference in productivity is phenomenal. With ZEN coding, I don't need these abstractions. I can just write HTML and I don't need to recompile every time I update it. I urge you all to try it. It will change your perception of writing HTML. Funnily enough, I now find it therapeutic.