Object-oriented Code Re-use - Fact or Myth?
One of the tenets of software development that is drilled into most everyone is this: write code which can be re-used. Object abstraction and compartmentalization - one of the hallmarks of C++ and other OO languages - was supposed to make this easier than ever. A given piece of software would only ever be written once, and then everyone could benefit from it.
In theory this should work. In practice I've never seen it done with code written in-house, at least in any way that couldn't be done with standard 'C' libraries. At any job. Ever.
Libraries and routines certainly get re-used by the developer who wrote them, and occasionally by other developers they know personally. Buying and using third party components and SDK's is also popular, as well as using toolkits such as STL. However, it's very rare for an unknown developer - without a personal referral - to pick up another unknown developer's code without being forced to.
Object oriented development encourages good practices in terms of object opacity and property protection, and this certainly has value. It promotes a certain way of thinking about solving problems which is generally considered to be good. I just don't buy into the proposition that the benefits extend any further.
If anyone has experiences which contradict my own, I would be very interested to hear them. I've only bumped into one person so far who claims otherwise, which doesn't make for a very good batting average.
Until then, I'll think twice before going out of my way to make code re-usable, since the chance of it ever actually BEING re-used is close to 0.