Good news! Inheritance and polymorphism can facilitate more concise code, which reduces waste throughout the lifecycle of a C++ product. By pushing more generic code into base classes, you can help reduce application code clutter as well as cutting down on code duplication. In this article, software consultant Stephen Morris insists that less code means less testing, lower maintenance costs, and easier upgrades.
I thought this was understood. I mean I have known about these concepts and the rationale behind them for some time now.
Add encapsulation and you’ve got the three basic criteria for OOP. Pretty well known I think…
…but is there some OSNews policy to link just about everything Informit publish regardless of its relevance or usefulness?
The only people I can see this useful for is people who pretty much taught themselves C++ on the fly from examples. Any C++ programmer knows how to use polymorphism and inheritance. Even the lamest “teach yourself C++” book will go over inheritance. It’s sort of a key idea in C++. Every body uses polymorphism but perhaps the “I taught myself C++” folks may just not know that it’s called polymorphism.
Tis a sad sad day for programmers when already established software developers need to be told these things.
Great News! I saved $617 by switching to Geico!
Whilst polymorphism and inheritence (as well as encapsulation, cohesion etc) can lead to slightly shorter development times in a small team, it can lead to big headaches down the road. Poor documentation and lack of overall design are the two things the OO mantra still doesn’t automatically handle. Without good foundations, the project will crumble no less quickly than a bad building in an earthquake.
Poor documentation and lack of overall design are the two things the OO mantra still doesn’t automatically handle.
It’s handled decently in Eiffel. Too bad the language encourages better documentation than the language has itself.
Whilst polymorphism and inheritence (as well as encapsulation, cohesion etc) can lead to slightly shorter development times in a small team, it can lead to big headaches down the road. Poor documentation and lack of overall design are the two things the OO mantra still doesn’t automatically handle. Without good foundations, the project will crumble no less quickly than a bad building in an earthquake.
This doesn’t really have anything to do with OO per se. Poor documentation and lack of design will cripple any project. OO will give you the tools for good design. It can’t do the good design for you.
Now if you have good OO design, it will bring productivity in spades.
Edited 2006-04-10 16:31
Good News! errr… I needed to publish something…
Just like procedural programming can lead to 1000-line functions making your code unmaintainable, overzealous OO-ers tend to cripple the project by making dozens of classes which are essentially the same, “just in case”.
IMHO this is even worse than the 1000-line function, because there at least you can lock yourself in your office and read it, whereas the 10-levels-of-inheritance-all-adding-nothing will make you lose the overview very quickly.