We sometimes tend to start projects where we have no idea whether they will work or not.
As people who like to code and create things, we more impulsively create things without giving much thought to whether the idea is actually good. Guilty. I too would sometimes write code for days thinking it’s a good idea, but after the initial excitement is gone, I realize that the idea is something I’m not passionate about anymore, or something that’s too big for someone like me to take on by myself.
And a couple of weeks later I will just open source the project and the code will be just dead code.
Or is it?
I have increasingly started to realize that no code is actually dead code. Whether it comes to work or my next idea, I can re-use the code that I have written for another dead idea, saving me time and allowing me to move ahead on writing something new.
For example, recently I started following an idea where I thought it would be cool to have users login with their GitHub.
But then I realized I already developed a small module that allows users to login with GitHub in an earlier side project, so all I had to do was just re-use the code, make some small changes, and that’s it.
I just re-used my older code.
So no code is dead code, as long as it’s good code. You will be able to re-use it for your next project or idea.
Happy coding.