News for hackers. Stuff that matters.
Re:Nana: A modern C++ GUI library by jstimpfle on Sunday April 21, 2019 @06:36AM (#19711468)
Callbacks are often not the best approach. How about "inverting" the control by having a function which first collects all the elements to act on and then acts on them? This should prevent problems with cache misses since you perform only one kind of thing (on all elements) at a time. Where this kind of reordering is possible.

(The callback approach is OOP I would say. And as always, OOP prevents us from seeing the better way to structure processing).

Re:Nana: A modern C++ GUI library by jcelerier on Sunday April 21, 2019 @07:57AM (#19711677)
problems happen as soon as the elements you want to display aren't known at compile time and can't be stored in a nice, data-oriented approach, but instead come from various plug-ins that the user can download and put as DLLs in the app's folder.