3 ms·
I believe the main motivation for these code snippets was not to point out the verbosity of the OOP style, but to draw attention to the fact that the onclick ha
by dthul 7y ago
I believe the main motivation for these code snippets was not to point out the verbosity of the OOP style, but to draw attention to the fact that the onclick handler mixes the concerns of updating the state and updating the UI. Or in the author's words:
"[...] duplication between the initial construction of the UI and updates. [...] to add a slider showing the value, the onclick handler also needs to be amended to add an update for that".