java – Object Oriented development

A lot more programmers have experience lately with multi-paradigm languages. Python, for example, is both procedural and OOP. Scala, for example, is both functional and object-oriented.

It’s not that OOP isn’t useful. It really shines when you have a clear inheritance hierarchy or when your functions and data make sense to be tightly coupled. There are other situations where it’s not a great fit. Functions that need to operate on multiple kinds of objects, or on collections of objects, for example. Or when you end up combining or “verbing” your nouns, just to create some monstrosity of an object like a VisitorFactoryAdapter.

In other words, there are situations where OOP is an excellent fit and situations where it’s a terrible fit. If you try to force OOP in the latter situation, I would consider that over-engineering. If you can’t recognize the latter situation because you have trouble conceiving of non-OOP designs, it’s sometimes helpful to swing the pendulum a bit too far the other way for a while.