4 ms·
I've always found such systems intolerably difficult to debug. Is there an option for 1,000 lines of imperative non-spaghetti? I've found that keeping the bulk
by to3m 14y ago
I've always found such systems intolerably difficult to debug. Is there an option for 1,000 lines of imperative non-spaghetti?
I've found that keeping the bulk of UI code in one place is the key to keeping these things manageable. Ideally, each widget's handler should do little more than affect whatever data it needs to affect, then call another function that updates all widgets' states according to the latest data.
For stateful sequences of events (e.g., mouse drags) the rx-style approach is a bit more compelling. Imperative code for that stuff is always ugly. But you still seem to have the same problem of debuggability if you use rx, and backing out of a state looks like it might be a bit of a chore.
Call me a Philistine, call me a barbarian...