DEV Community

Discussion on: Sometimes, the elegant implementation is just a function

Collapse
 
yucer profile image
yucer

I think the industry, having over-worshipped the object-oriented paradigm, is now veering in the opposite direction.

I have also the same feeling. And I feel it is because of the type of problems that the industry is facing nowadays.

I strongly support the OOP paradigm not only because it aligns to the way the complexity is organized in the real world, also because it provides solid mechanisms for extensibility.

I did program games 20 years ago with old programming languages that didn't support OOP. It was very hard to make abstractions. Since I found the OOP paradigm it was easier to build the behaviour of the game components and reuse it in others. Many enemies shared the way to move, or shoot, etc.

Of course there were problems that, by its nature, didn't need such mechanisms. But at the end they also feed into a class method.

So what can I do in a function that can not be done in a class method ?

I don't see the OOP as a replacement of the old procedural paradigm. I see it as an extension, the same way that the theory of relativity is an extension to the theory of mechanics.