Object-Oriented Programming – The Trillion Dollar Disaster
medium.com
medium.com
And that is in some ways related to the consumer nature of the programming stacks in use: If there isn't a named-and-documented "feature" for it, and it's not in the hype cycle, it's a less legitimate, more hyptothetical technique.
But what are those other ways? Where's the starting place? My own WIP answer is:
* Data modelling techniques(beyond algorithmic complexity concerns: data lifecycles, persistence, schema design, and so forth)
* Formal models of finite state(decision tables, statecharts, behavior trees, and so on)
* Constraint solver techniques and their many applications(type checking, physics steps, pathfinding, depedency checking, UI automation).
* Dataflow modelling, with static routes and bounded buffers.
* DSP techniques used to do analysis and filtering of digital events at scale.
There's still an overarching tendency to let execution flow get out of hand, and our current trend for asynchronous concurrency is an antidote only in the sense that it motivates the existence of rigor by blowing up easily.
In C++ and Java, you have these member variables, that act as global variables within the Object. Any member variable can be accessed at any time, either read or written to, by internal functions that are allowed to modify it.
This appears to work ok, while you write out your toy code for your CS 101 class, but it doesn’t seem to scale too well when developing real-world production code.
What I find better about Functional Style development, is that my functions are much smaller, and all inputs to the function, are validated, and its outputs fall within a narrow band that is acceptable. And by forcing the validation of all inputs, this tends to stop defects during development, very quickly, and very visibly.
The unit testing of pure functions becomes simpler, and it allows you to systematically perform rigorous validation of your code.
The added benefit, is that once I build out my functions, then all that complexity, is hidden behind a one-liner function call. And I just pass data containers from one function to the next, until I get my final desired result.
This helps to minimize the footprint of the codebase, that I must remember and internalize.
And since most of the parts are just dumb components, now, I can focus on remembering the core parts of the business logic instead.
Nothing is absolutely perfect of course, but this is as close to a programming silver bullet as I can get.
Looking forward to reading about the Quadrillion Dollar Disaster in 10 years.
OOP, functional, generic, data-oriented, reactive, whatever. It's all just programming. The mistake is trying to be "pure": different jobs, and different parts of any job, call for different methods. Everything has a place.
Add to your toolbox, but don't lose what you have.