Eric Brunson
Posts: 1
Nickname: brunson
Registered: Feb, 2006
|
|
Re: Which Part of "No XML" Don't You Understand?
|
Posted: Feb 3, 2006 9:36 AM
|
|
So, I've been thinking about this for the past few days and before I launch into my comment, let me say a couple of things to lay foundation.
First, in general I hate XML and I avoid it whenever possible, I'd much rather write or maintain a Config file than an XML file. I've also found that there are way to many abominations that were built on XML and there are way to many programmers that see XML as the solution to everything.
Second, I'm not a particular fan of any single templating engine I've seen, but I've looked at most of the same ones Guido has mentioned in his weblog.
Finally, because of the extreme high regard in which I hold Guido, my first reaction to reading these weblog entries was, "Hmmmm... Guido says it, so it's probably right. I'd better take stock in what he's saying."
So, with that in mind, after a couple of days reflection, here are my thoughts:
WTF is with this "No XML" crap? XML is definitely not the right tool for every job, but it certainly has its place.
I hate hand editing XML, but then again, I hate hand editing HTML, but in each case I have two options: 1) Write something that does it for me, like a WYSIWYG HTML layout program, or 2) Suck it up. The fact is, I hate the HTML that every WYSIWYG editor I've every used generates, so I resort to option 2.
The only templating engine I've used extensively is Kid because I've been learning TurboGears and at first I resisted the XML syntax the way I originally resisted the required whitespace in Python.
However, just as the whitespace serves it's purpose in making code clean and readable, I like the fact that kid templates are directly renderable in a browser. This means I can more easily hand off the HTML generation to someone more artisticly gifted than I am (or to a lower paid programmer that has no choice but to deal with the tedium) and they (or I, or anyone else) can view their work by simply viewing the file in their browser.
In particular the implementations that Guido pointed out in Cheetah and Django are, to me, hideous and totally unpythonic. I switched to python to get away from the $#~*&@ line noise of Perlish languages, and these templates just throw it back in.
And the argument against XML/SGML not having a proper solution for if/then/else carries about as much weight with me as people complaining that Python doesn't have a 'case' statement. There are work arounds, use them because the benefits outweigh the detriments.
So, I wish could sit in an ivory tower using only the tools I deign to use (because it would almost always be python), but only the BDFL and a few others actually have that luxury. I am a lowly programmer and in order to continue putting food on my family's table I have to stoop to developing in PHP, Shell, XML and even (shudder) Perl at times. And when I do, I resort to option 2 above. In this case I feel that the benefits of an XML implementation are sufficient to outweigh the annoyance of writing it and I haven't seen a good alternative put forward. So, I think it's time to Get Over It(tm).
Of course that's just my opinion and I could be wrong.
|
|