Live data from Hacker News

If you code HTML, Zen Coding will change your life

downloadsquad.com

1–10 of 44 posts

Re: If you code HTML, Zen Coding will change your life

#2
Zen Coding seems like the Haml philosophy implemented as code completion rather than as a run time compiler. The upside is that the markup you generate is plain old HTML that any web framework can serve. The downside is that it has the readability of plain old HTML.

Re: If you code HTML, Zen Coding will change your life

#4
post #2

Zen Coding seems like the Haml philosophy implemented as code completion rather than as a run time compiler. The upside is that the markup you generate is plain old HTML that any web framework can serve. The downside is that it has the readability of plain old HTML.

And that upside would go away, because you could just configure your deployment tool to do the 'rendering' upon deployment, generating HTML that could be served by any framework.

Re: If you code HTML, Zen Coding will change your life

#8
The thing I don't like about all these ways to "improve" HTML/CSS is that they all seem to assume the rest of the webapp ecosystem doesn't exist.

Take SASS's variables and arithmetic, for instance. I agree that CSS desperately needs some way to abstract out common values. But any decent webapp will already be using some sort of template system, and the template system will have some sort of variable. Why not use it and be consistent with the rest of your UI? If you introduce SASS into the mix, you just have to do things one way in your CSS and another way in your markup.

Same thing with Zen Coding. Instead of using an editor plugin that expands abbreviations (which then have to be maintained), why not use your template system and avoid writing all that code in the first place? If I were writing the example listed here, it'd look something like this:

  
    
      
        {{#CELL}}{{/CELL}}
    
  
(That's using google-ctemplates because it's what I work with daily, but substitute in Django, Cheetah, Mako, or erb as necessary.)

Yes, there's still room for improvement, and yes, I wish my editor were more aware of available template variables. But I also don't have to maintain the 5 separate tags once I've typed them out, I can change one and have its updates be reflected across all the generated code. I can avoid those pesky closing tags by simply not typing them; the HTML spec doesn't require them, all browsers handle it fine, and it saves end-user latency as well. And I don't need to learn a new tool, I just have to use my existing tools better.

Re: If you code HTML, Zen Coding will change your life

#9
There's a reason why C compilers aren't implemented as editor macros that convert what you type into assembly, as you type it. It's because a high-level programmer never wants to work at that low level; he should never see the lower level. Ideally, he shouldn't even know that the lower level exists. (When was the last time you debugged your CPU microcode?)

If something is so cumbersome that it needs to be abstracted away, do it right. It's really fun to press a few keys and watch a bunch of code show up, but it's even more fun to not watch it show up. Because then you have something that's not a write-once operation.

Post reply on HN