According to this wiki post, David Wheeler pretty much summed it up..err..at least as far as our 70% (just a wild guess) of the effort go as we make a living as programmers and solution architects…when he said “All problems in computer science is solved by another layer of indirection except for the problem of too many layers of indirection”.
Here’s my take on this:
First of all “I Agree!”. Absolutely! We thrive or at least try to on re-using what is already out there. Every new version of a module should at least try and get most out of what is already there, unless the previous version was a complete disaster and a re-write is absolutely necessary (converting vb.net code to java). Re-writing from scratch is so very tempting because you don’t have to read what is writtern by others. Sometimes it just seems so logical to use the new framework. Only if time was not a factor. To re-write or not to re-write? Mostly, not to. Now back to re-using. Almost always, most of the code in the last version do not meet the means to solve the new problem. So what do we do (especially when the prevoius is from withn a third-party library)? Add another layer of inderction.. a proxy object that connects the old interface to the new interface. And if that does not solve everything add another layer. It does introduce complexity through explosion of objects.. but isn’t that what interface based programming is all about?