Tuesday, September 28, 2004
Why XHTML Must Fail
I'm looking at revamping most of voidspace - probably making it XHTML compliant and using CSS. CSS seems very nice and much easier than I'd expected. Changing from HTML to XHTML however seems to be more about following annoying and nit picking rules. You can only close nested tags in the same order you opened them, all lowercase and don't forget that tags like img and br need to be self closing - yuck !
Don't get me wrong, I've had to write a few parsers in my time - so I understand some of the issues. It's just that I thought that text markup should more appropriately follow human friendly rules, rather than insisting the humans bend themselves for the sake of the machine. I prefer to have my markup tags in uppercase to help them stand out from content, and if 'br' doesn't need a closing tag for it's meaning... why refuse to display a page because it's missing ? Herein lies the reason that XHTML is bound to fail.
Problem : HTML is usually handwritten and there are so many mistakes made that writing a parser that can cope is nearly impossible. The fact that most browsers do cope is a) testimony to their programmers and b) encourages sloppy HTML. Or at least so it is said.
Solution : Make HTML XML compliant with a DTD that defines it. *Any* XML parser that is given the DTD can now parse (read) XHTML. Make the rules strict - you are not now supposed to display non-compliant XHTML. This should force people to write good XHTML.
But... a proper XHTML browser shouldn't display badly written pages. So you can't view certain pages - your browser just shows an error message. Except your mate uses a different browser which displays the page fine. Oh - so your mate has a *better* browser then ? Technically no, in practise yes. As a consumer you are more likely to go for a non compliant browser that will actually display the page ! So as a browser writer you know that you will have the edge if your browser will display pages that other browsers don't. Bingo - problem unsolved agan and XHTML is more yucky to write than HTML.
Rant over - in the meantime I'm thinking of writing my content in reST and dynamically generating the markup from that....
posted by Mike Foord on Tuesday, September 28, 2004
Friday, September 10, 2004
Well.... I've finally done it. I've finally worked out basic authentication over http. It's not actually very complicated - but the documentation in http references *and* in python manuals is all hopeless. They simply assume you already know what it is you're trying to find out..... If I had the time I'd explain here :-)
Needless to say approx.py will very shortly support full basic authentication....
posted by Mike Foord on Friday, September 10, 2004