6 ms·
I find all this code so hard to read, because there are very few elements being composed together. It reads like one monolithic chunk of code (and with a global
by haskman 6y ago
I find all this code so hard to read, because there are very few elements being composed together. It reads like one monolithic chunk of code (and with a global state!).
I find code enjoyable to read and write when it's like Lego. You build small little self contained pieces and join them together. It makes a big difference when building large applications.
I wrote an example in [Concur](https://github.com/ajnsit/concur https://github.com/ajnsit/concur) to demonstrate what I mean - https://gist.github.com/ajnsit/f0fee9a83480289a5a052273ce21cc1b https://gist.github.com/ajnsit/f0fee9a83480289a5a052273ce21c.... The "app" is composed of self-contained widgets, each of which are short and easy to read, and have a defined purpose (show the searchbox, render a story etc.) In a larger app, they can be mixed and matched together in logical ways.