• entries
    121
  • comments
    278
  • views
    156012

Reinventing the Wheel

Sign in to follow this  
Promit

187 views

Here's another entry that fell off the Obvious Train. Sorry guys.

Reinventing the Wheel

One of the more common sayings in programming is, "don't reinvent the wheel". For a lot of situations -- arguably the majority -- this is completely appropriate advice. However, every so often, it is in fact necessary to reinvent the wheel. The problem is, what kind of wheel are you going to turn out?

One of these wheels is a lot more sophisticated than the other. Just because a wheel needs to be reinvented doesn't mean you have any business doing the work. When this question comes up, most people's focal point is whether or not the wheel needs to be reinvented at all. Sometimes it does. But is the person who would be doing the reinvention actually sufficiently competent to make a nice wheel? The answer is rarely "yes".

Take STL containers. Are they always good enough? Of course not. They have certain goals in mind, and if those goals are not similar to your own goals, they may be very inappropriate for you. But if you decide to reinvent those containers, there's a very real danger that you'll do such a poor job that you were better off with the prewritten version. You don't need to be "better" than the people who wrote the standard library, but you do need to be good enough to meet your goals more effectively than those containers can. That's not always easy, and many of the people who are convinced they must do so are exactly the people who have no business doing it.

So how do you know if you're competent enough to make a better or more appropriate wheel? If you need to ask, the answer is no. If you're looking to create your own quality wheel, it follows that you know a thing or two about wheels. That familiarity with wheels should already give you the ability to judge if you can make a better one. If not, you simply can't. (I'm ignoring the situation where the original wheel was done by a completely incompetent moron, which happens.) So to those of you who want to know if the standard library (regardless of language or platform) is good enough, the answer is yes, it is. Now it's probably a very good experience to make a few wheels yourself anyway. They'll come out crappy, but that's how you learn. But don't for a second think that you can jump right in and create a better one.

Oh, and one last comment to those of you who design wheels. Please don't screw it up, like on the Civic Hybrid:

It makes it a lot harder on us when we have to explain why people shouldn't do their own wheels.
Sign in to follow this  


2 Comments


Recommended Comments

I invented a wheel once. It had spinnaz.

Or something along those lines. I added the spinnaz first and kind of spaced out on what the rest of the wheel was supposed to look like.

Are there supposed to be this many square edges?

Share this comment


Link to comment
Quote:
You don't need to be "better" than the people who wrote the standard library, but you do need to be good enough to meet your goals more effectively than those containers can. That's not always easy, and many of the people who are convinced they must do so are exactly the people who have no business doing it.

Which requires you to know exactly *what* your goals are, and why the existing wheel doesn't measure up. Which is difficult enough in itself.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now