[Solved] Why in OOP you do everything in objects? [closed]


You choose object-oriented programming when encapsulating data and behavior into classes, whose instances, maps well onto the problem you’re trying to solve.

Not every problem is best done with objects. There are other styles of programming – functional and declarative come to mind – that are also good. Most of the scientific programming that I know of is done using functional or procedural languages, not objects.

Object-oriented languages can be verbose when compared to functional styles.

If OOP does map well onto your problems, you need not program with objects.

I don’t know much about objects in PHP, but I’d guess that they’re an afterthought. I wouldn’t consider it in the top five languages for object-oriented programming.

Perhaps the problem has as much to do with you as it does the implementation or language. It might seem strange if you’re not used to thinking in terms of objects.

1

solved Why in OOP you do everything in objects? [closed]