Josiah B
1 min readDec 15, 2021

--

The problem runs deeper than SRP. Common industrial OOP design doesn’t actually result in decoupled software. FP, design, on the other hand, which is based on mathematical principles, does this better. Your coupling in OOP systems comes from the fact that OOP couples procedure to the data, and when you do that, it forces coupling across the entire system. And the design patterns like dependency injection that are used to help create decoupled OOP systems are actually FP designs in disguise (dependency injection in FP is implemented as Reader Monads and curried functions, for example, and these techniques are supported naively by the FP languages, no need for XML configurations and dependency graphs).

OOP the right way and as Alan Kay and the original proponents intended involved zero interdependencies between classes — everything was to be implemented through message passing. The only semi-popular languages I know of that supported this style were Smalltalk and Erlang. However, Java and C++ are what made it in the industry, but their so-called OO style isn’t what pioneers like Alan Kay and Ivan Sutherland actually envisioned, but as they were what became popular, that’s what people came to understand OOP to be. In reality, the Java and C++ style does not encourage decoupled and maintainable software architecture, but actually works against you in that endeavor.

--

--

No responses yet