Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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".



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: