4 ms·
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
by jstimpfle 8y ago
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).
- jcelerier 8y agoproblems 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.