Tuesday, February 10, 2015

Why you should reinvent the wheel

If you have wandered among forums, and questions on websites like Stack Overflow long enough, you will be familiar with the phrase “Don’t reinvent the wheel”, which basically means don’t write code that’s already written by someone, or don’t waste your time writing code that would do things that can already be done by using frameworks. I’m going to tell you the contrary: Reinvent the wheel!
Because once you reinvent the wheel, you’ll be familiar with how the wheel is supposed to work, allowing you to modify it in ways that would make it more efficient for your particular use.
Frameworks sound pretty, code already written by someone else saves a lot of time, but when things don’t work like they’re supposed to, you’re bound to spend time scratching your head, unless someone already encountered a similar problem, and posted the solution online (which supposedly is the most common way people fix their code).
There are two primary benefits of reinventing the wheel, or writing code from scratch by yourself:

  1. You’ll get to know how the wheel works:
    When you start writing code from scratch, and you understand what you’re doing, there’s no doubt that you’ll know how, and why things are happening like they are.
  2. You’ll have complete control over all the features:
    When you’ve written the entire thing from scratch, you’ll know what features you have added. You will be able to put only those features that you require, leaving out access code, and complexity. You will also be able to integrate those features with any other framework that you’re using in your code.
But don’t use your wheel. Why did I tell you to reinvent the wheel, and then tell you not to use your wheel? Because the mainstream wheels already developed will be more stable, more secure, and would have more community support. You might also find lots of forks, and add-on features developed by fellow developers.
How you will benefit from this: You know how things are working behind the scenes. You know how, and what to modify in order to make the code do exactly what you want. You’ll also be able to make the existing, stable, secure framework work hand-in-hand with another existing, stable, secure framework. You’ll be able to develop add-ons to make your code more functional. And the best part? You’ll be able to share all the expertise you gained with the community!

So the next time you're thinking about integrating a framework on your project, stop and try to code it on your own!

No comments:

Post a Comment