Towards Principled Reactive UI
In practice, an immediate mode API is clearly the way to go.We've all seen "smarter" approaches failing more than a few times, obviously on the simplicity side but also, sadly, on the performance side, even with all the caching and retained structures.This is the strange beauty of brute force algorithms, they may look dumb and ugly for our refined human minds, but they tend to map very well to the capacities of computers.It is often faster to not bother and blindly render something instead of running complex logic to decide if you really need to render or not.And if you're not satisfied with the performances of a "dumb" imgui, you can always add some smarter caching without touching the API.Altough I bet this approach would only get you marginal benefits.