2 ms·
I did not read full post but the introduction kind of surprised me. The example of "object oriented style" the author gives is artificially inflated to look rid
by FpUser 7y ago
I did not read full post but the introduction kind of surprised me. The example of "object oriented style" the author gives is artificially inflated to look ridiculously verbose. Modern languages with OOP and anonymous functions capabilities and some library help can make code the same or even less verbose representation than the declarative example mentioned.
- oaiey 7y agoTotally agree. He lost me there as well, which is a pity because I like these kind of theory posts. Any reasonable modern language (Swift, C#, JavaScript) can represent the positive sample very closely. I also do not see the relevance of this argument for for the reactive UI topic.
- krzat 7y agoUIKit code looks much worse than that.
- dthul 7y agoI 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".