logoalt Hacker News

jemmywtoday at 4:26 AM2 repliesview on HN

> The DOM is very ill-suited for most UI. Too complex and lots of missing features

Can you expand on this, because I'm not seeing it myself. The DOM, html+css is very flexible. It easily encompasses most UI. Most UI is some kind of data display, so lists, trees, tables, forms.

The need for JS might be what you're complaining about. I think we might be stuck with it as a UI control language forever.


Replies

neutronicustoday at 12:25 PM

I don't know about "most UI" but it's sure as shit ill-suited for CAD (what I work on).

show 1 reply
skydhashtoday at 5:25 AM

The DOM(and CSS) is primarily built for documents and forms, even with the latest addition like Flexbox or Grid layouts. It is closer to typesetting tools like troff, latex, texinfo than any UI engines you can think of. And some that are not needed, like the difference between <i>, <a>, <span>, <strong>,...

Also with most GUI frameworks, there's some difference between widgets like label, button, menu, checkbox,... and containers that does layout management. And there are not a lot of elements in both sets. This is the reason why React Native has a very sparse components library. With simpler implementation, you have a simpler rendering path, and the developer have less elements to deal with.

Also some have ready-made implementation of really useful widgets, like tree, grids, tables, lists, and other dynamic things. You can find libraries for those on the web, but the web implementation of scrollable container is janky.