Hacker News new | past | comments | ask | show | jobs | submit login

I don't want too sound negative, but there are a number of reasons this is a less than feasible idea.

First it's overkill. The reason we have a www at all is because HTML and its variants are dead simple. If the client decides that six key sentences should be yellow and emphasized, I go into my template and add a <span class="yellow"><em>Yellow text!</em></span> to my template.

Using your generator, I now have to figure out a whole new way of doing that.

The second point follows: Any first year web monkey can learn to add spans and em's. It takes a bit more effort to understand python. While this might not matter to someone who understands both, it offers much less flexibility to the already available alternative.

Django's template implementation is very, very good. It fits quite well into your average web shop and even fails silently.

I like your desire to scratch your own itch, but I felt I should answer your question.




Er, or you could do <em class="yellow">Yellow Text!</em>. But that's not even the best. What if he wants to change the color later? <em class="specialEmphasis">Special Text!</em>.

CSS classes should be used sparingly and by purpose: they should describe the function of the element, and not the look of the element.

But that's just semantics ;) (har, har).

ASP.net uses code generated html for a lot of things: server controls, some user controls, and so forth. It can be a pain to override them if the markup they generate is crap (and from my experience, the built-in server controls and many of the 3rd party controls generate crap).


You could, but I get to use my yellow text elsewhere, sans emphasis. :P

Not calling it yellow I think is the more important piece. In fact class="sctmtdt" seems best to me.

* (Stupid Client Told Me To Do This) :-)


If you ever name a class yellow, you've entirely missed the point of CSS.


I think it's safe to assume that the class name was chosen for demonstration purposes only.


Bad examples don't help to prove a point.


Maybe it should be:

  <span class="client_wants_yellow_client_gets_yellow">Yellow!</span>


And if (when) the client changes their mind?


I'm pretty sure he was joking.


Yes, that's true, but I was trying to illustrate a simple concept.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: