Conceptual flaw in pxdom?

Diez B. Roggisch deets at nospam.web.de
Tue May 19 12:16:11 EDT 2009


Emanuele D'Arrigo wrote:

> On May 19, 6:50 am, Stefan Behnel <stefan... at behnel.de> wrote:
>> It's pretty easy to write unmaintainable code that uses the DOM API,
>> though.
> 
> I'm finding that at my own expenses...
> 
> Why would anybody want to use the DOM? I suppose the main reason is
> that it is one of the most reliable standards around. It might be more
> complicated, but that's probably because lots of very smart people
> thought about it very carefully and it couldn't be made any simpler.
> And hopefully will stand the test of time.

Sorry to say so, but that's nonsense. DOM is not complicated because it
contains anything superior - the reason (if any) is that it is formulated
as language-agnostic as possible, with the unfortunate result it is rather
clumsy to use in all languages.

Additionally, it *attempts* to unify APIs in browsers, unfortunately it is
only moderately successful.

APIs such as ElementTree don't try to burden themselves with the
language-agnosticism, and thus are much more powerful.

And no, I don't think being language-agnostic is a virtue in an API. Simply
because this can never really be reached, and then is questionable anyway.

Diez



More information about the Python-list mailing list