Live data from Hacker News

Rethinking DOM from first principles

acko.net

181–190 of 234 posts

Re: Rethinking DOM from first principles

#181

Earlier quoted context omitted.

What I mean is, I dont see why browsers even exist. There should be a singlular framework for creating desktop apps.

> There should be a singlular framework for creating desktop apps. Why?

Well why have two completely different ecosystems for the wbe and desktop/mobile applications, especially in terms of UI? Both can network

Re: Rethinking DOM from first principles

#182
post #128
post #117

Earlier quoted context omitted.

Text selection is such a great example precisely because it is incredibly useful to have in many unexpected situations (and a great many more that should be expected), but UI designers as a rule do not think about these situations! It is so bad that one of the most impressive operating system features to be added in recent years is the ability to select and copy arbitrary text from app UIs, using either accessibility…

+ even when websites decide to be a pain and block text selection/copying, you can fix that with extensions.

Extension not necessary:

In Chrome, open DevTools, Shift+Ctrl+P > Disable JavaScript

Re: Rethinking DOM from first principles

#183
post #174

Earlier quoted context omitted.

Plenty of great UI toolkits exist. WPF was an amazing UI toolkit. Heck Silverlight was a great UI toolkit. Even Swing was nice to code in, it just ran horrible on machines of the time.

Hard disagree. Lots exist but none are great. Usually layout isn't sane. Another blunder is components are too complex with too many layers. Customization and creating your own components becomes difficult. Often the event system is terrible. Eg Swing has all those problems, in addition to ugly themes. The uncanny valley resulting from trying to mimic native UI was bad. At least nowadays users don't necessarily expec…

Swings layout stuff was fine, better in 2004 than anything the web had until 2020 at least.

Also now nothing resembles native platform UIs, so that isn't a big deal. Swing was very theme-able, which is all anyone cares about now days.

Re: Rethinking DOM from first principles

#184

Uggghhh, the article states correct facts about the DOM but grossly incorrect conclusions. Most developers have always feared working with the DOM. This irrationality is not new. I have no idea why, but tree models scare the shit out of college educated developers. That’s supremely weird because computer science education spends so much energy on data structures and tree models. It also makes the conversation about W…

I closed my web dev business just three years ago. I found that many people who work with the web don't want to do the work to understand how it all works. They think there must be a library somewhere to do "that" while doing "that" is simple enough using standard components and features. Another issue is people basing their fears of things in the past. Yes, the web was more difficult to do fancy things but often the…

I found the same at my last two tech jobs (S&P 100 and 500). People hate getting their hands dirty with fundamental web dev.

My favorite part of web dev is working directly with the DOM, vanilla JS, and using minimal dependencies (if any).

I feel like the web equivalent of an assembly programmer these days, but apparently nobody is interested in hiring for this sort of thing anymore.

Re: Rethinking DOM from first principles

#186
post #185

This website looks awesome. Seriously.

Ugh I love this website and a year ago I was desperately trying to remember the name - trying to describe the concept to chatbots trying to get a lead. I just had to wait around to run into it on HN again.

And now leave a comment for when I inevitably forget again.

Re: Rethinking DOM from first principles

#187

Earlier quoted context omitted.

The reason working with the DOM directly is hard is that you have to implement arbitrary patching to go from one state to another. The entire point of frameworks like React is to avoid the problem, by automatically creating and applying the patch for you. It's not irrational; quite the contrary.

Yeah, I prefer vanilla DOM and I don't have any problems with state. State is as ridiculously simple as storing state of user interactions to an object, saving that to somewhere like localStorage, and the applying it on page load. React makes this ant hill into a mountain of complication.

Ever use knockout.js?

I think it had/has the perfect balance of utility without being overly opinionated. State was also much easier to deal with.

I haven't used it in a while, but still look back on that project fondly.

Re: Rethinking DOM from first principles

#188
post #58

Uggghhh, the article states correct facts about the DOM but grossly incorrect conclusions. Most developers have always feared working with the DOM. This irrationality is not new. I have no idea why, but tree models scare the shit out of college educated developers. That’s supremely weird because computer science education spends so much energy on data structures and tree models. It also makes the conversation about W…

> I have no idea why, but tree models scare the shit out of college educated developers. Very few people are "scared" of tree models. The problem of working with the DOM is that it's: - 90s JAVA-like verbose unwieldy API that requires tons of boilerplate to do the simplest things - Extremely anemic API that is neither low-level enough to let you do your own stuff easily, nor high-level enough to just create what you…

> when you so much as change an element border (which may trigger a full re-layout of the entire page)

This is easily avoided: use 'outline' instead of 'border', or just keep the border width fixed and change the border color to/from transparent.

Re: Rethinking DOM from first principles

#189

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…

Much of this complexity comes down to primitives being too primitive for the use case of web apps. They’re fine for documents, but for web apps it’s like trying to build a building from grains of sand instead of concrete blocks. Rube Goldberg machines are unavoidable when you’re doing that. The browser should be doing most of the heavy lifting by providing a full suite of minimally themed but capable widgets that req…

you have put into words a feeling that has been burning in my chest for 20+ years :-)

I cry at the ways we are doing and defining column tables.

Re: Rethinking DOM from first principles

#190
post #80

Devs have learned not to keep state in the document, because it's inadequate for it. Web devs have moved the state out of the document into JS variables and have been piling bloated, short-lived crap on top of those variables ever since. If you actually keep state in the document things become rather simple. Scripts themselves become stateless and do not require direct dependencies on one another. Data can be queried…

Conflating presentation and data seems like a classically Bad Idea. Changes to presentation break your business logic.

Your business logic should be behind a server.
Post reply on HN