|
Posted by: stak
Posted on: 2007-05-05 14:04:37
People generally seem to think that reinventing the wheel is a bad thing. Although it can be bad sometimes, there are a lot of cases where it's much better to start from scratch and if necessary, reinvent the wheel. The problem with reusing the wheel is the same as with a lot of things: hidden assumptions. The person who invented the wheel designed it with a certain set of assumptions that weren't documented. Any time you attempt to reuse the wheel, it is quite possible that one or more of these assumptions won't hold, and so reusing the wheel is inefficient at best, and just plain wrong at worst.
One of the assumptions with the wheel, for instance, is that it will be used on a flat surface. If you use a wheel when going up an incline, it requires additional machinery (brakes) to prevent it from rolling back down. If you were to design a car that only went uphill, and you decided to reuse the wheel, you'd have to add a braking mechanism to go with it. On the other hand, if you decided to reinvent the wheel, you might end up with something that looked more like this:
The things sticking out of the wheel would allow it to roll forward (towards the left in the picture above), and would prevent it from rolling backwards. No brakes required (assuming the wheel is strong enough to hold the weight of whatever it's carrying, etc.). Clearly, this solution is more efficient than having to add a complicated and unnecessary braking mechanism.
The same principle applies whenever the choice of reuse vs. reinvent comes up. More often than not, reinventing an item will be more efficient for the overall design, because the item will be redesigned while taking into account the specific context it will be used in. In software, this problem seems to come up over and over. The Ariane 5 disaster was a result of precisely this problem - code from the Ariane 4 was reused, and one of the assumptions (upper bound on acceleration) was no longer valid, resulting in a system failure.
If every system available for reuse were to document every single assumption about the context it expected to be used in, this probably wouldn't be too much of a problem. Although possible in theory, I'm pretty sure this is impossible in practice - most of the time people make assumptions without even being aware they're doing so. One solution is to simply never reuse anything, but that's just as stupid as blindly reusing everything. The correct solution lies somewhere in the middle - reuse whenever possible, but not before going over every explicit and as many implicit assumptions about the system as possible, and making sure that the costs are outweighed by the benefits.
|
|
(c) Kartikaya Gupta, 2004-2024. User comments owned by their respective posters. All rights reserved.
You are accessing this website via IPv4. Consider upgrading to IPv6!
|