Hacker News new | ask | show | jobs
by jakelazaroff 1033 days ago
Consider that those layers of abstraction exist for a reason? Let’s say you can’t see very well. This is what I hear when I enable VoiceOver on macOS and open Discord (either the web app or the desktop app):

1. “Discord, friends - Discord window, direct messages, selected cell”

2. “You are currently on a cell inside of a table. To navigate the cells within a table, press…”

3. (when navigating with the keyboard) “1 mention, $SERVER_NAME, cell” “$SERVER_NAME, cell” etc

And here’s when I do the same with a random Dear ImGui app I have installed:

1. “$APP_NAME, $APP_NAME window, $APP_NAME window”

2. “You are currently in a window”

3. (when navigating with the keyboard) [silence; no additional instructions]

So that Dear ImGui app is entirely unusable for anyone who needs a screen reader. This is something every React app — really every web app, period — gets basically for free.

And it’s not just screen readers, right? It’s different viewport sizes and alternate character sets and right-to-left text and user-defined fonts and searching through text on a page and the zillion-and-one other things that you either take for granted or don’t need at all but are crucial for millions of people.

Yes, if you could make a good UI by just filling a frame buffer with pixels, web browsers and React would all be hideously over-engineered. But we don’t live in that world.

1 comments

This is a good criticism of ImGui, but feels like a false dichotomy. I don't think it's the many layers of DOMs and tree diffing that makes screen readers work well on browsers. Conversely, there's nothing about the ImGui abstraction that makes screen reader support impossible. ImGui already sees all of your text and buttons, so no reason why it couldn't send those to a screen reader as well as the screen.

All in all, I don't think "there is a reason things are the way they are" quite means "the way things are is actually the best they possibly could be".

Sure, I don’t disagree. Browsers and frameworks are extremely heavy. I do think there’s something to be said for having these affordances on by default. Screen reader support in Dear ImGui isn’t impossible, but that’s a super low bar that puts the onus on developers. Browsers do it out of the box! Our tools should lead us into the “pit of success”, where it’s easy to do the right thing and hard to do the wrong thing.

I don’t want to get too hung up on Dear ImGui. The official repo says that it’s meant as a developer tool rather than for building end-user UIs, so it’s not a fair comparison. My point is simply that all these things require layers of abstraction. Maybe the way things are isn’t the best way, but even the best-case scenario will be significantly more complex than what you described once you start adding in the things I mentioned.