This has really been hitting me lately, as I try to understand a legacy program whose original authors are long gone. But not in a way that implicates OOP.
The code is written in a functional language, and, while it's not one like Haskell whose compiler enforces any rules about referential transparency, I have yet to encounter a single mutable variable. However, it is constantly poking at a database, and different modules communicate with each other asynchronously over a message queue. And those two things are making it just impossible to reason about program state at a macro scale.
To me, it really speaks to how functional programming is not the panacea it's often made out to be. I'd honestly prefer if it were just some crusty old Java monolith where all the objects are stateful, and have setters for every field, and all that good^H^H^H^H stuff. Because, while that kind of statefulness may not be well-isolated, it is navigable. I can splat-B and cmd-F7 my way into a decent understanding of how the application's state is getting twiddled. With this, I'm having to grep the code and manually sift through the lexical search hits to find what I need to know.
The code is written in a functional language, and, while it's not one like Haskell whose compiler enforces any rules about referential transparency, I have yet to encounter a single mutable variable. However, it is constantly poking at a database, and different modules communicate with each other asynchronously over a message queue. And those two things are making it just impossible to reason about program state at a macro scale.
To me, it really speaks to how functional programming is not the panacea it's often made out to be. I'd honestly prefer if it were just some crusty old Java monolith where all the objects are stateful, and have setters for every field, and all that good^H^H^H^H stuff. Because, while that kind of statefulness may not be well-isolated, it is navigable. I can splat-B and cmd-F7 my way into a decent understanding of how the application's state is getting twiddled. With this, I'm having to grep the code and manually sift through the lexical search hits to find what I need to know.