Let's Write a Toy UI Library
Key topics
The quest to build a toy UI library has sparked a lively discussion around the complexities and considerations involved in creating a user interface from scratch. Commenters are weighing in on the intricacies of window management, the potential pitfalls of scaling a toy project, and the importance of accessibility features. While some are praising the tutorial for tackling a often-overlooked topic, others are criticizing the author for not prioritizing accessibility, with some defending the author's decision as a necessary compromise given the constraints of a personal project. The debate highlights the challenges of balancing simplicity with inclusivity in UI design.
Snapshot generated from the HN discussion
Discussion Activity
Very active discussionFirst comment
6d
Peak period
21
144-156h
Avg / period
8.7
Based on 26 loaded comments
Key moments
- 01Story posted
Dec 16, 2025 at 5:31 AM EST
18 days ago
Step 01 - 02First comment
Dec 22, 2025 at 2:32 PM EST
6d after posting
Step 02 - 03Peak activity
21 comments in 144-156h
Hottest window of the conversation
Step 03 - 04Latest activity
Dec 23, 2025 at 7:14 AM EST
11 days ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
UI frameworks are one place where outside of toy projects, YAGNI doesn't really apply as much, and so things like focus systems and accessibility affordances should be factored in from day one. If you go in with the attitude of writing something "elegant", you're going to end up bolting these things on after the fact and writing contorted code to make it all fit together. It's like finding out that you need a skyscraper after building foundations for a cottage.
You can avoid this complexity in the base widget class by placing those elsewhere, e.g. FLTK's base widget class[0] is much smaller at around 500 lines of code (+ documentation comments).
[0] https://github.com/fltk/fltk/blob/master/src/Fl_Widget.cxx
> Am I being harsh? Well where's the tutorial that teaches people how to do it properly? Where do people actually learn the right way if not here?
I would love to read your blog post on how to do so! After all, since you seem to imply that time is free for everyone, you shouldn't have any problem making that blog post.
Or, you know, if you say "This is how you make a UI library" maybe you could think about ... what a USER INTERFACE actually is? Because blind people are users? and we need to interface?
People write tutorials on what they are interested in, what they have knowledge of, and what they want to share.
Accessibility is an important topic, to be sure, and is clearly of particularly high importance to you. Others might complain that they didn't include how to create a high performance table view, or embed an OpenGL view. I think most people, however, will take it as what it is - a well written, helpful contribution.
Your comment specifically asked if you were being harsh, and the consensus appears to be "yes". Perhaps if you worded things differently you might get a different response.
Tactless.
You don't have to make a complete alternative. You can add calls to ATK (accessibility toolkit) on Linux/Unix platforms. I'm not sure what needs to be done on Win32 platforms though.
Well, I guess accessibility is one thing it skipped. It's a huge topic, I admit, so I'm not particularily surprised, but I think a better way for the author of this series would be to promote already existing huge toolkits that do have lots of functionalities built-in, including accessibility, like Qt for example.
That would be good also because already established huge toolkits have already answered a lot of important questions, questions which "modern" GUI toolkits simply ignore. New generations won't even know what we had when we were young.
Do you walk into a beginner woodworkers class and scoff at them for making yet another birdhouse?
Imagine wanting to understand how an existing technology works…
Primarily because OP actually did call out accessibility as a concern. That is the opposite of teaching the reader to ignore people who use a11y features. Nor is it OP's responsibility to teach their readers anything they don't care to.
And yeah, where are the tutorials you'd like to see? That could have been a more constructive thing for you to share yourself instead of demanding it from no one in particular.
They also didn't include text rendering for scripts that are written right-to-left, nor for scripts that are written vertically.
Clearly they are not intending to provide a complete and comprehensive course on every aspect of the ideal UI library.
Rather, why don't you make your comment constructive and tell us about accessibility? I am sure there is an "accessibility for noobs" tutorial out there that the rest of us haven't discovered. I, for one, just recently learned about colour blindness in games and was absolutely mad when I saw what the example game in the book looks like to a colour-blind person. Not that I'm much of a designer, but I'll be sure to choose a universally-good colour palette next time I do any UI. So teach us instead of yelling at us.
https://gist.github.com/a3f/22d0d2688b56e79865f8