Skip to main content

I hate the "Don't reinvent the wheel" advice

September 16, 2024

We have all heard it before: “Don’t reinvent the wheel”. It is meant to be a practical advice, urging us to use existing solutions instead of wasting time creating something that already exists. But honestly, I almost always hate this saying.

Reasons

Reason 1: It Stifles Innovation

Imagine if Elon Musk (founder of companies like Tesla & SpaceX) had listened to those who said “don’t reinvent the wheek”. Cars and rockets already existed, after all. But, by challenging conventional wisdom and pushing the boundaries of what was possible, he revolutionized entire industries. Tesla reimagined the automobile as a sustainable, high-performance machine, while SpaceX is disrupting space exploration with reusable rockets and ambitious plans for interplanetary travel. If he had simply accepted the status quo, these groundbreaking advancements might never have happened.

Reason 2: It Assumes One Size Fits All

Consider the world of databases. While relational databases like MySQL and PostgreSQL have been the go-to solution for decades, they aren’t always the perfect fit for every application.

For example, if you are building a social media platform that needs to handle massive amounts of unstructured data with fast read and write speeds, a NoSQL database might be a more suitable choice. If your application requires complex graph relationships like recommendation engine or a social network analysis tool, a graph database like Neo4j migth be the ideal solution.

Sticking with traditional relational databases in these scenarios, simply because “that’s how it’s always been done”, could lead to performance bottlenecks and/or scalability issues.

Reason 3: It Discourages Learning

The process of “reinventing the wheel” can be incredible valuable. By figuring things out for ourselves, we gain a deeper understanding of how things work, develop problem-solving skills, and potentially even discover improved methods.

I was always fascinated by how compilers parse code strings and build an AST out of them. The process always felt magical. In college, I had one compiler course. Most of the professors just told us to use Lex to generate tokenizers and Yacc to generate parsers. When I asked them how they worked internally, I used to get responses like, “It is a solved problem. You don’t need to worry about it.” At that time, I just ignored this curiosity bug of mine, but in the past few years, I have been very curious about this again, and I started exploring how I could build a lexer and a parser tool from scratch. Today, I can build a lexer and a parser for any modern programming language in a week without sweating. It may not be the most performant, but it gets the job done. The concept of lexing and parsing is no longer magical to me, and this makes me super happy.

I have more respect for the Lex and Yacc tools now that I understand how they abstract away all the complexity and handling of edge cases behind lexing and parsing of a program.

Reason 4: It Can Be Demotivating

Imagine pouring your heart and soul into a project, only to be told you are “reinventing the wheel”. It dismisses your effort and creativity, even if your solution is unique or better in some way.

Conclusion

Of course, there are times when using existing solutions is the most efficient approach. But let’s not discourage the spirit of exploration and innovation that drives progress. Sometimes, “reinventing the wheel” can lead to amazing discoveries and advancements.


Always remember the above image. The first ever invented wheel was made up of stone or wood. We don’t use them in our modern day vehicles because we “reinvented” a better wheel.