4 ms·
> In other words, UI programming is about mapping incoming events to a series of effects. So I guess the word `event-driving programming` is lost in time. And
by innocenat 9y ago
> In other words, UI programming is about mapping incoming events to a series of effects.
So I guess the word `event-driving programming` is lost in time.
And I don't think the Unidirectional pattern described is suits for C programming. When I see people use C, I think performance, and unless the compiler optimized it away the state mutating function is gonna cost a lot of unnecessary memory copy. And worst offender is that unless you have React-like UI diff-ing library, it's gonna be a costly entire screen redraw event for the most simple update.
- clarry 9y agoWrite a game or an editor with support for macros and see if it isn't faster to first mutate the state and then finally render, rather than doing thousands of ad-hoc screen updates, most of which won't be visible in the end anyway.
- innocenat 9y agoAnd then we arrive at dirty marking, etc. Unless you also consider that state manipulation (which I don't think it is).
- DSMan195276 9y ago> unless you have React-like UI diff-ing library, it's gonna be a costly entire screen redraw event for the most simple update. He's using ncurses, which actually does that - it only redraws the parts of the screen that change. It can require a bit of coxing at times to ensure that things get redrawn properly but I'm pretty sure he's good - I didn't see anything in his code that would force a full redraw every update.
- radarsat1 9y ago> He's using ncurses, which actually does that - it only redraws the parts of the screen that change. Heh, when I first read about React, my immediate reaction was like, "oh so it's like ncurses for the web, cool, makes sense."