61 ms·
It's code and state. Nothing more. Nothing less.
by AlexanderDhoore 6y ago
It's code and state. Nothing more. Nothing less.
- jl2718 6y agoMy first computer book was: “Data Structures + Algorithms = Programs”. Thinking in this way has simplified my code tremendously. I think OO is taught because it’s more tactile. Literally it takes more keystrokes, and so much is pattern repetition that it facilitates learning and feels like progress. Functional is like learning Latin by studying Ovid one word at a time. When books (or mips) were expensive, this was how it was done. Even OO is old-school now though; today’s introduction to programming is mostly configuring CSS and webpack.
- jimmaswell 6y agoOO is just the most intuitive way to compartmentalize state to many people, me included.
- cessor 6y agoI feel the same way.
- atoav 6y agoIt often is, unless you solve a problem where it isn't (and at some point you will). Nowadays I try to be very pragmatic about these things, but before I had a certain realization I just wanted things to fit neatly in classes and saw some beauty in it. That was until I started using rust where this wish initially lead to a lot of frustration. When I finally gave in and did it the Rust "compositional" way, everything worked incredibly smoothly
- cessor 6y agoHow do you model changes in state over time? (i.e. effects and processes?)
- AlexanderDhoore 6y agoIs this a trick question? You mutate the state, of course.