Inheritance misunderstood

In C++ inheritance is not for code reuse. Full stop. Think subtyping. Think interface. Think substitution. Think specification. Learn about LSP – Liskov Substitution Principle. Never ever think reuse.

I’m amazed, shamefully, how often I forget about it and I drift away thinking how to save on keyboard use and typing.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>