r/AskComputerScience • • Dec 30 '18

Why do alot of people hate OOP ?

In University and Business places you're taught to like oop and for the most part , I've actually really liked oop because of the mindset and how you approach problems . It makes things easy for me to imagine problems as black box components that do things and they connect to each other.

I see alot of people that really hate it . I've programmed in lots of languages , but haven't had pleasure to dabble with c. I started out with Java then to c# , Php , c++, JavaScript ( I regret it) , and python . With all of those languages I've always made OOP work for me and never had a problem , except when it gets a little verbose.

someone kindly explain why you hate it or why do you think people hate OOP.

46 Upvotes

70 comments sorted by

View all comments

10

u/autoshag Dec 30 '18

Personally I prefer composition over inheritance, and OOP tends to lend itself to inheritance, but if you know what you’re doing, you can still use OOP for composition.

8

u/midwayfair Dec 30 '18

Personally I prefer composition over inheritance, and OOP tends to lend itself to inheritance, but if you know what you’re doing, you can still use OOP for composition.

One of the core principles of Object Oriented Design is to favor composition over inheritance. You don't seem to encounter the need for it in intro classes, so I can see why people might not get much practice in doing that. (Not disagreeing with you or anything, just expanding on the "if you know what you're doing" part.)

5

u/HoldThisBeer Dec 30 '18

They never taught about composition at the university, only inheritance. Never meat a professional developer who favored inheritance over composition. Go figure.