Please Reinvent The Wheel

Please differentiate Reinventing vs. Refining or Re-implementing. ReinventingTheWheel implies that out of sheer ignorance or stupidity, you are re-doing the hard work that someone has already done (and everyone but you knows about it). Making incremental improvements to the wheel, making a wheel out of a new material (or language), etc. is _not_ ReinventingTheWheel.
I had this thought when thinking about EnterpriseJavaBeans:

Hey, ReinventingTheWheel is easy ... I bet I could do it! Sure, doing it the first time took a brilliance that I don't claim to have, but since I've already seen a wheel, I bet I could do it in no time, especially if I had my favorite tools. Maybe I would find a good log, saw off a section, strip the bark off the section, sand it down and drill a hole through the center for an axis, why not? Add another day to that, and I could have a whole wheelbarrow built. It wouldn't be ideal, but it would be simple and allow us to move stuff from one place to another. When we need more, we could re-investigate the issue, maybe buy a car or a truck. But when presented with a MakeVsBuy? decision, I never seem to have the choice to buy a simple wheel and wheelbarrow, I have to buy a car. And my home brew wheelbarrow may be a little clunky, but man, the amount of maintenance involved in a car is huge: gas, drivers license, traffic laws, car insurance, oil changes. Goodness! But at least we can focus on our core competencies, and not have to be ReinventingTheWheel.
Sometimes we are told not to be ReinventingTheWheel. But what does this mean? Look around. There is no one "wheel." There are lots and lots of different kinds of wheels. They seem to be designed specially for the context in which the wheel is needed. The wheel for a tractor is not the same wheel as for a bike, except in concept.

And there are places to buy all those kinds of wheels and more. I believe ReinventingTheWheel is, to continue the metaphor, the idea of spending six months designing a wheel for your tricycle when you are next door to Joe's House Of Tricycle Wheels, over 100,000 in stock. -- RobertField

There is the idea of a wheel. A pattern of the wheel. That we should know about. That we can be taught. And that we can reuse. But when the idea of a wheel is needed it is usually necessary to make the wheel according to the forces of the problem.

So, PleaseReinventTheWheel.

Isn't this re-implementing or re-making a wheel? Re-invention is when you come up with the solution independently, because you haven't bothered to look to see if someone solved it before, not when you re-implement a solution you already know about

Yes, this is true, and that's the problem.

When you need a list to be sorted given some constraint, and somebody tells you to find a preexisting implementation instead of re-inventing the wheel. Except that you have no intention of re-inventing it, just re-implement a solution you already know about, refactored to be once-and-only-once in its context.

What about those who keep re-inventing the SquareWheel? Hey, maybe they're driving on sawtooth roadways.
I'd bet real money that the 2nd wheel worked much better than the 1st wheel. -- EricHodges

Actually they added so many new features to the second wheel it became so heavy you couldn't carry any load and it became so complex that it broke all the time and nobody could fix it.

Which is why they made the 3rd,4th...nth wheel. Just ask any auto manufacturer how much they spend re-engineering and re-designing new wheels, suspension systems, hubcaps, tires, anything to do with their wheels it will become apparent that ReinventingTheWheel is not only common, but necessary.

In some cases, making your own version is a really good way of learning about something.

"I reinvent the wheel because I'm smarter than you. ... Oh, that's why he did it that way."

Sometimes it's worth-while to spend time building your own wheel -- just to learn something about wheels -- even if you end up going with someone else's wheel. For example, it's not a waste of time for every student in a class to write their own program to sort things -- learning about function calls, off-by-one bugs, debugging techniques, BigOh notation -- even when they later learn that simply calling qsort() (or some other standard library function) is usually the best way to sort things.

see PotteryChallenge.

It's usually a bad idea to put shopping cart wheels on a race car, bicycle wheels on a monster truck, and some combination of 4 different types of wheels on a single vehicle, just to save the trouble of building an appropriate wheel.

Also, sometimes it's quicker to build a wheel such that you have full control of the design, specification, and implementation rather than to research all the details of existing wheels, select and test them, determine how they will interact with the rest of the system, build a possibly-massive integration layer, etc. Quicker isn't always best, but that depends on your priorities.

See also: PolyBloodyHardReuse, BlindAlley

View edit of March 19, 2012 or FindPage with title or text search