by sodapopcan · 5y ago · 0 comments
This is not to say there aren't good use-cases for OO (video games come to mind) but for my day-to-tasks, I've found FP much simpler (and immutability is a god-send... it's like, "Hey, you know that foot gun you've been carrying around? You don't need that anymore!"). I would encourage any OO zealots to give FP a honest try.
That's my problem with OO too. It encourages people to add unnecessary mutable state to programs and then they have to think about it interacting with everything else and with itself.
When you realize most systems are actually pretty simple once you look at the fundamental data and how it changes and ignore all the architecture built around it - it's a very freeing experience.
> This is not to say there aren't good use-cases for OO (video games come to mind)
Gamedev is currently moving away from traditional OO towards Entity Component System - which is basically a in-memory relational database for your data + imperative code put into classes that are basically modules :)
I am hoping that your application has a function for UnscheduledWorld -> ScheduledWorld.
> I would encourage any OO zealots to give FP a honest try.
Why assume that people who like OO more than FP do so only because they haven't tried FP? Isn't it possible that you are in the honeymoon stage with FP, and as you gain more experience with it (like you have with OO), "the scales will fall off your eyes" as P G Wodehouse would have put it?
0) Procedural
1) OO
2) FP
3) Really started to dislike mutability
4) Developed various FP frameworks
5) Back to pure (immutable!) OO and messages!
Lenses look like a solution to transition 'deep' immutable state, but I find them cumbersome: YMMV.
Object Orientation has excellent composability with regards to state and with minimum fuss.
The step I took is to eradicate mutable OO state, and replace it with a pure OO substrate.