Hacker News new | ask | show | jobs
by unimpressive 3470 days ago
DOM has some serious advantages, to name a few:

- Machine readability. Graphics scraping is gross, but DOM is by default a machine parseable format.

- For web pages which are actual documents, it makes total sense and is in fact a pretty clean implementation of a document and styling system. Especially in comparison to stuff like Microsoft word's doc format. If you would like to dispute the point, I challenge you to design something better. You don't even need to implement it, just make a compelling design. Or link to somebody else who has.

2 comments

The second point is the only valid defense of the DOM, in my opinion. It's just a static document formatting language. And it should have stayed that way. Webpages like the one we're on right now should have been the furthest it went.
And we'd then probably be complaining about the other thing that got invented to do the rest of the work that the DOM currently does.

Something would have appeared to handle the interactive aspects of the web. What makes you think it would have turned out better?

The problem with the DOM is that it tries to solve two problems at once: encoding of semantics, and encoding of layout.

I'd say we should forget about the former, because ML techniques can extract semantics to a great extent. IMO, the DOM should be considered purely a layout tool.