Uche said:
After all, DOM pretty much sucks.
Uche,
You're the second person in a week to express that sentiment, after
the EffBot last week. I was going to make some points in reply to <f/>
last week, but held back. But now that it's come up again, I thought
I'd chip in my €0,02.
I mostly agree: the DOM sucks. But only when it is used for purposes
for which it was never designed.
DOM was designed to be a simple object model for documents, which was
easily manipulable with script languages. But, most importantly, it
was designed for use on the client side only, i.e. in the browser. So
although the DOM is a *huge* memory hog, this is not a problem in its
natural environment, the browser, where only 1 DOM is created per
document being viewed.
The problems come with DOM when people start doing stupid things with
it, like trying to use it in server applications, and creating
multiple DOMs to service every single client. IMHO, people are asking
for trouble when they do that, and I have little sympathy for them.
I feel that DOM has gotten bad press because of these kinds of
misuses: I still believe that DOM is great for what it was designed
for: non-server, script-based simple document manipulation.
regards,