Live data from Hacker News

Rethinking DOM from first principles

acko.net

101–110 of 234 posts

Re: Rethinking DOM from first principles

#101
post #49

People often lament how DOM, HTML and CSS are becoming more and more complicated: the difficulty with simple and/or common tasks like vertical centering or virtualization, 600+ CSS properties, so many JavaScript methods, leaky abstractions, { contain: size }. I agree on many issues, but equally I struggle to imagine how it could realistically be not complex. If it was a result of a single very well thought through vi…

While the web has grown complex in line with increasingly complex applications, the platform is also undeniably bloated, precisely because every new feature (like HTML in Canvas proposal) has to be shoehorned into an already very fragmented puzzle. Backwards compatibility has become an idealistic badge of honor rather than a technical feat. I believe the article does a good job at getting into the technical parts tha…

It’s frustrating to me that we don’t have more directives. I’m simply spitballing however, here’s some examples:

We have but why not add other doc types as time goes on? Instead of shoehorning features you could have a which would opt a web page into the ability to use newer features like newer elements or cleaner APIs

There is also the “use strict” directive in JS (which any script tag with type=“module” runs in now, slowly eliminating this need) that would opt your script into a stricter form of JS. You could even do it on a per function basis. We could have something like that for other features or stricter qualifiers etc.

We have done this before successfully and broadly, I think it’s time we revisit the usefulness of doing this again

Re: Rethinking DOM from first principles

#102
post #42

Earlier quoted context omitted.

> I struggle to imagine how it could realistically be not complex. Pretty easy, we should have had 2 standards, one being "Web for applications", built on a VM, stdlib, bytecode, RPC, UI framework and standard library of controls, ... And "Web for web pages" which was a solved problem pre-HTML5 days. Java and Flash (although very problematic from a security point of view) were probably better bases on which to build…

I struggle to see the reason why web pages and apps are even two different things. The browser is really just a cross-platform platform for building applications.

Yes, a terrible one. That's what the article is about.

Re: Rethinking DOM from first principles

#103
post #75

Earlier quoted context omitted.

20 years ago it was much easier, you could ethically use tables for layouts which semantically did not make much sense, but in terms of code structure it was very simple: this table is the full size of the page, this cell is the header with this height, this cell is the sidebar with this width, this cell occupies the rest of the space with content positioned in the middle, all expressible without any styling at all.

This sounds crazy to me, the flex system is exactly this but also semantically correct. You can’t possibly be telling me that table hacks of yore are easier than this, a clearly designed system for the actual problem you want to solve https://css-tricks.com/wp-content/uploads/2022/02/css-flexbo... I’m not at all a frontend person, I just think flex is one of the best systems I have ever used. It usually gets the job…

No, tables are the right solution: nonoverlapping elements arranged in a sane way that is easy to reason about. The arguments about semantics so everything can be a div are hilarious -- it really doesn't matter.

Re: Rethinking DOM from first principles

#104
post #95

I like the DOM. I think people keep forgetting all the small details, like being responsive (working on mobile and desktop) and many other issues related to privacy and usability. IMEs, dictionaries, spelling correction, etc... All of these happen in text areas. If you implement things yourself, say in canvas on a webpage, you can't provide these. For example if I misspel somethng the browser can lookup that word in…

Flutter is amazing exactly because it was a response to the problem of creating modern cross-platform apps for the modern zoo of hardware. The text typesetting engine from the 80s is clearly not a good foundation for it. It's probably safe to say that the majority of the dev workforce in the last 2 decades started their career with learning HTML/JS/CSS stack, and it's understandable why they like it. It doesn't make…

You had a great comment I had saved last time this topic came up: https://news.ycombinator.com/item?id=41981458

It's true, what people think of as native on the web are merely incidental from its history, not some ironclad law of how to make interfaces.

Re: Rethinking DOM from first principles

#105

All those words, and yet not once did he even mention the entire reason everything is the way it is: to preserve backwards compatibility. It's like writing an entire diatribe about how it sucks that people can insult you online, and how that should change ... and not even mentioning the benefits of freedom of speech.

It can have such a reason to be the way it is, and still be bad.

Re: Rethinking DOM from first principles

#106
post #42

Earlier quoted context omitted.

> I struggle to imagine how it could realistically be not complex. Pretty easy, we should have had 2 standards, one being "Web for applications", built on a VM, stdlib, bytecode, RPC, UI framework and standard library of controls, ... And "Web for web pages" which was a solved problem pre-HTML5 days. Java and Flash (although very problematic from a security point of view) were probably better bases on which to build…

You'd still have all the same backwards compatibility problems with the "Web for applications" stdlib and UI framework as we do now.

You just use the novel solution of downloading the whole thing as an applet.

Re: Rethinking DOM from first principles

#107
post #56

People often lament how DOM, HTML and CSS are becoming more and more complicated: the difficulty with simple and/or common tasks like vertical centering or virtualization, 600+ CSS properties, so many JavaScript methods, leaky abstractions, { contain: size }. I agree on many issues, but equally I struggle to imagine how it could realistically be not complex. If it was a result of a single very well thought through vi…

> Yes, some applications tend to have a large amount of markup for what seems like simple features (the Slack’s input box example). However, the alternative is that browser vendors bake it all in, and then every app is stuck with the opinionated way they think is right. Perhaps some amount of chaos is healthy. Or, you know, provide a set of usable controls that provide useful functionality out of the box and provide…

TBF, Turbo Vision was also a better toolkit than most of what was available for '90s GUI systems. Or a lot of '00 GUI systems.

...hell, native apps are still more likely to be crap than not. Good UIs are hard and programmers are lazy; the big advantage of web apps remains the difficulty of an app completely crashing the browser due to sheer developer apathy.

Re: Rethinking DOM from first principles

#108
post #83

Earlier quoted context omitted.

Flex is great but tables are also a natural solution for anything grid-based, which of course layouts almost always are. The whole internet used to do stuff like this before the structural flow of content became important: header sidebar content

Bring back the 90's. ;) The memories of spacer gifs...

I still find myself missing Macromedia Fireworks on occasion!

Re: Rethinking DOM from first principles

#109
I've been looking at native development for quite some time now (WPF/WinUI/SwiftUI, starting with Win32 and AppKit), and honestly Web technologies are much better than that. The fact that it is cross-compatible is just a cherry on top.

If finally WASM gets a cheap and easy way to manipulate DOM, I think even more stuff will move towards web tech like Electron and hopefully Tauri in the future.

Re: Rethinking DOM from first principles

#110

I've been looking at native development for quite some time now (WPF/WinUI/SwiftUI, starting with Win32 and AppKit), and honestly Web technologies are much better than that. The fact that it is cross-compatible is just a cherry on top. If finally WASM gets a cheap and easy way to manipulate DOM, I think even more stuff will move towards web tech like Electron and hopefully Tauri in the future.

I totally agree. I don't get why people feel so strongly that native apps are better. The web technologies we have are great both from a developer experience perspective and a UX perspective. People hate on electron apps but I think this is mostly due to bloat from electron. I hope Tauri closes the gap it's been great for me so far.
Post reply on HN