Member-only story
Why Developers Fall Into the Trap of Reinventing the Wheel Costing Themselves Time and Causing Undue Stress
We know not to reinvent the wheel, but avoiding doing it isn’t always easy.
This week I fell into the trap of reinventing the wheel when trying to code a feature.
I was trying to develop my schema for storing recurring events. Thinking my problem was unique, I felt I had to make my own format. I ignored all the other apps and file formats that already support storing recurring events.
I realized how easy it is to think our problems are unique and convince ourselves we need to invent a new solution.
Very few problems in programming haven’t already been solved.
We don’t need to figure out how to code most features cause someone has already put a similar solution out there.
Will writing an original solution for one feature add value to the project? We add value by solving a problem or providing entertainment in an entire program, not reinventing the wheel. The time we spend trying to invent our solutions is time we could have spent improving other areas.
Before you start going to invent your own solution take these three steps.
#1. Check for existing packages you can use.
If there is an existing package, it will be quicker and better than what you can write.
If it isn’t the main problem you are solving, don’t hesitate to use existing code.
#2. Look for tutorials, blogs, open-source projects.
Developers love to explain and teach tricky problems they solved.
Search Stack Overflow, blogs for your platform and industry, open-source packages, and google for existing solutions.
#3. Don’t assume your problem is unique.
No matter how unique you think your problem is, there will be a similar solution online.
You might need to make some tweaks or combine multiple solutions, but few problems don’t have an answer already. We need to find them.
Don’t lose days like I did trying to reinvent something that had already had a standard solution.