February 8th, 2009
Oh, finally somebody completed this sentence. This “Don’t reinvent the wheel” (or “Don’t invent the warm water” as we say it in Croatia) makes me feel bad whenever I code something that has already been done. And I’ve made a lot of libraries somebody already has done better then me. Like my own image viewer. Or XML reader/writer. There’s also form designer, workflow designer, TCP server-client messaging system, 2D tiled graphics engine, 3D terrain engine and probably more different wheels I’ve made someday.
Why I constantly redo something that’s already been done? There are three reasons. First, to learn more about this specific wheel technology. Second, wheels on the market didn’t quite fit with my gears. Third, those wheels came with their own air, nuts and bolts. Specifically, I built my own image viewer because bought one let me down in most inconvenient moment. I wanted my own 2D tile engine because I wanted full control over it. I learned 3D graphics programming while building my own 3D engine. In-house workflow designer allow our partners to produce incredibly flexible workflows targeted for a specific industry.
Although most of developers I know tell me that reinventing the wheel is wrong, in most cases my experience is different. Actual code as a solution to a specific problem area most of the times is simple. Testing and debugging is more expensive and that’s the part where you profit the most if you use existing, widely accepted solution. It’s probably been tested more than you could test it in your lifetime. But the most difficult part of introducing a library in a project is the integration part. And that’s where your own wheel will be much, much easier to use. It has familiar interface, known capabilities and no hidden features. It’s extensible on the site and takes no time to learn. If something goes wrong, you know who is responsible and who can fix things the fastest.
So, before you shout “Don’t reinvent the wheel!” at me, please, take some time to think about the wheel and how wheels work.