Blake Smith

create. code. learn.

»

from revision one to revision done

About a year ago, I was working on a personal coding project. It was nothing major - I wasn’t building a new operating system or writing the next cutting edge web framework in the hottest new programming language, but it was something that was important to me. It was a simple web app that would help me with train times on my daily commute. I remember after working on it for several weeks and one night getting so frustrated with its progress that I wanted to just rm -rf the whole thing and be done with it. It wasn’t that I was stuck on any specific problem, but that I didn’t feel the quality of my code was living up to my own expectations. It was starting to get ugly. My code was terrible and it looked unfixable without throwing the whole thing away and starting over.

There was a lot of insecurity there. There are so many other open source projects that I was following, and watching all the amazing commits pouring in each day was starting to make me depressed. Here were all these programmers all over the world who were finding a way to be productive and contribute and write beautiful code each day, and I was stuck with my silly little programs that were not elegant, or beautiful, or really admired at all by any of my other peers.

On a daily basis, I would check the commits that were coming in to the Rails project repository on github. I was following the comments, reading through the commits and trying to keep track of all the changes that were happening with the Rails team. It was enough to make me pretty pissed off. Why couldn’t my code look like that?

It was in this moment that a realization came to me. Maybe it wasn’t that my code was bad, maybe it’s that it just hadn’t had enough time to fully grow into what it was supposed to be. Maybe I hadn’t given it enough time to mature and evolve and become the good code I had hoped for. Could it be that I just haven’t given my little project enough of a chance? Should I cut myself some slack and just keep putting in the work to make it better? Could some aggressive refactoring make this heap of smelly trash not stink so much? Maybe I won’t have to delete it after all. That’s when I started to wonder: could it be possible that other software projects go through this same phase of adolecence and immaturity that my code is in right now? Do all software developers wrestle with this initial “This code makes me want to barf” situation? These questions comfronted me quite forcefully.

So I checked out a copy of the Rails git history. And then I checked out revision 1 of the code, and I started poking around. You should really do this sometime. Find an open source project that you really admire. Maybe you admire it because of the clean code, or the program’s utility in your life, or because it’s been a tool that you’ve been able to build upon to make other great things. Think of the project that seems so great and bold that it appears nearly ‘unreachable’ in your mind. I’m talking about the kind of project that makes you think “I could never write something as cool as that”. And then check out revision 1. And then study it.

More than likely you’ll find that this project that you’ve put on such a high pedestal started out just like the very project that you’ve been toiling with on your own. It started as just a breath of an idea, that came into existence as something simple and useful. The other guy writing the code probably felt the same insecurities you’re feeling right now. Over time, given enough work and care and the chance to evolve, it blossomed into something great. It becomes a great narrative that probably started as something crappy, and slowly transformed into something large and grand and wonderful. This is what I found when I looked at the first revisions of the Rails code. It took a long time for it to turn into the often over-hyped phenomenon that it is today.

Don’t think that your code has to be an instant success. This isn’t American Idol we’re talking about. Don’t think that it has to be instantly a magnificent piece of art. Every day, put in the work to make it incrementally better. With enough time and care, the small idea that’s taking shape inside your head and inside your computer will become something bigger than you had ever imagined when you first started on it.


about the author

Blake Smith is a Principal Software Engineer at Sprout Social.