Skip to content

Is Object Oriented Programming Too Complicated?

blog.bishopuniverse.com
1 pointDavidBishop3 comments
On HN

Comments

Inheritance isn't the only way to re-use code. Using inheritance won't solve your problems, and it tends to give you new ones: http://en.wikipedia.org/wiki/Fragile_base_class

"But if you write code that doesn't change the existing system, you simply test the additions" boils down to the open/closed principle. It's much safer to create a new class (often by inheritance) than to modify the guts of an existing class that already has dependencies.

I think OOP is easy, so long as the system you are modelling can in fact be broken down sensibly into distinguishable objects. However, a lot of people try to use an OOP approach when this is not appropriate and end up getting into a bit of a mess.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.