There is much talk about the dangers of too much inheritance and how composition is better then inheritance - and probably they are right if we are talking about the final product. What they don't account for are the dynamics of the development - where you grab the first thing that does something similar to what you need and you start testing it, changing it, evaluating your ideas. Inheritance allows you to do exactly that - making changes to something that was already finished and working somewhere else. With procedural code this is not possible, the most similar thing you can get there are examples.
In other words Inheritance might lead to tightly coupled code, with intricate execution paths, but at least it is an easy way to get something working quickly. You can refactor it later.
Thursday, September 23, 2010
Subscribe to:
Post Comments (Atom)
1 comment:
On the subject of composition vs. inheritance, I have just written a post about that myself, relating to some changes to a Perl module framework of mine.
http://leonerds-code.blogspot.com/2010/09/perl-ioasync-version-030.html
Post a Comment