4 ms·
The two things that have helped me write clean GUI code the most are having some sort of event bus and following the MVVM pattern. The event bus helps you to de
by flukus 9y ago
The two things that have helped me write clean GUI code the most are having some sort of event bus and following the MVVM pattern. The event bus helps you to decouple various parts of the UI, like when a certain menu item has to be disabled by certain data. MVVM let's you embrace the inherent statefulness of UI's and to test them.
Both add a fair bit of complication in the short term but reduce it when the app gets bigger. Neither seems to suffer from the performance/correctness trade off that other methods (like forcing every minor change to redraw the UI) often have.