Felix Dahlke is a software developer particularly interested in games and open source. He writes most of his code in JavaScript, C++ and Python. Felix is a DZone MVB and is not an employee of DZone and has posted 16 posts at DZone. You can read more from them at their website. View Full User Profile

Reimplementing the Wheel

02.28.2013
| 2661 views |
  • submit to reddit

Assuming you’re a programmer, I bet that you’ve heard the phrase reinventing the wheel before. I really think we should stop using it. For two reasons:

1. It’s actually reimplementing the wheel

The phrase is almost always used when someone is implementing something that has been implemented by a library or framework. (That’s at least what my anecdotal evidence suggests.) So it’s reimplementing, not reinventing. Reinventing would be someone implementing a sort function, but completely ignoring all research done in that area, trying to come up with their own algorithm. I don’t think that’s common.

But there are valid reasons for implementing something that has been implemented before, here just a few:

  • You want to actually understand what’s going on, and be able to tune freely, because it’s an important part
  • Libraries age far more quickly than research, and are not available in all environments
  • You just want to keep things simple (note that I’m not using simple synonymously with easy here)
Of course, there are valid reasons against doing that as well, for example:
  • It’s faster
  • You and your colleagues don’t need to learn and remember the theory
  • Depending on the library and programmers in question, often higher reliability
So it’s sometimes the right thing to do, sometimes not.

2. It’s condescending

It might be said with the best of intentions to safe someone else from wasting time, but it’s still saying they’re actually wasting their time. Without having a clue about why they chose to implement something themselves instead of using an existing implementation, that’s downright condescending.

Making assumptions about something you don’t know is generally not a good idea. Why not assume people actually know what they’re doing unless evidence suggests otherwise?

Published at DZone with permission of Felix Dahlke, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Lund Wolfe replied on Sat, 2013/03/02 - 4:42am

It is very condescending.  Reinventing the wheel is a worst practice, but most of us have seen a lot of it.  We just assume it is due to inexperience and ignorance of available libraries/frameworks/tools.  It is a distraction and time waster at best and shows micro-thinking when more abstraction would get more done faster without making simple things difficult, fluffing up the code base.

The opposite is also bad.  We've all seen apps or libraries that have a gazillion dependencies and suffer bloatware on the external dependency side.

Felix Dahlke replied on Wed, 2013/03/06 - 3:54am in response to: Lund Wolfe

I haven't seen people reimplement something without a good reason (doing it for educational purposes on private projects is a good reason in my book). Maybe I haven't worked with that kind of person. But I've suffered quite a lot from dependency bloat.

What I do see quite a bit is people starting their own library instead of contributing to those already out there (when it would be perfectly reasonable). Seems to be a common thing in younger communities like those of Node.js and Clojure, and I don't think that's a good thing. But I am mostly talking about reimplementing something for your own special use case, not to throw another badly maintained library out there.

The point I'm trying to make is just that there are perfectly valid reasons for reimplementing something instead of relying on libraries at all costs. So I disagree, it's not a "worst practice". It can be, but you simply can't tell without knowing the details.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.