Your legacy code matters

Craig Hockenberry tweeted about some stuff a couple nights ago:

Meanwhile, I’m back in Virginia for Thanksgiving and, on a lark, decided to start digging through my closet. I found some old shirts and some bad fantasy novels and a couple floppy disks filled with some of my first programming:

It was great to actually poke around these things (thanks to the equally old PC we have which still sports a floppy drive.) I’m impressed, for instance, that my ability to give variables descriptive names was actually pretty strong for a middle schooler before I discovered the gospel of var x in high school. 1

It felt like flipping through an old grade school yearbook.

——

Wang Dàpéng created a tool that plucks your first commit from GitHub, a sort of programming Timehop. It is delightful.

My first commit is for a repository called vivi. It’s the first steps towards a Python static-site generator, with a couple blog posts thrown in for good measure. It features tabs in lieu of spaces, but the code is still pretty Pythonic beyond that.

More striking to me than the actual commit, though, was the time at which I wrote it: August of 2012, when I spent the summer in Seattle as an intern in the U District.

I didn’t have many pictures of that summer: it was a quiet and somewhat lonesome one. But browsing through this repository, I remember so much — the long afternoons spent biking the Burke-Gilman trail, the evenings spent happily holing myself away with an IDE and Sinatra’s discography. It makes me feel warm.

——

I spend a good chunk of my free time developing for iOS. I like the platform; I like Swift; I don’t necessarily like Apple, but I think they make very nice products, and I generally enjoy the time I spend inside XCode.

The repository to which I’ve pushed the most commits is Barback, a Swift app. Between Swift’s rapid evolution and my own rapid maturation as a mobile developer, the sense of legacy code nostalgia is compressed. I look back at commits from a year ago and chuckle at my ignorance 2.

I worry, as Craig says above, that all of these artifacts will be rendered unretrievable. Will I be able to compile Swift five years from now? Will I be able to run this code on an iPhone five years from now?

The answer is probably no.

——

Programming is an important part of who I am. I’ve spent more than half of my life developing things — for work, for fun, for the unmeasurable thrill of creation and discovery. Those artifacts are just as important as Instagram photos or grade-school yearbooks: they are reminders of who you were and where you’ve come from.

Old code is absolutely worth preserving. (The ability to run it, too.)

Spend some time digging through the artifacts of your (recent or otherwise) youth. You may be delighted with what you discover.


  1. A gospel I have since forsaken, don’t worry [return]
  2. Or, as is more often the case, my laziness [return]
Subscribe to my newsletter to be notified when I post something new (every few weeks):

Justin Duke is a writer and developer in Seattle.
He likes good, practical things.
(And writing in the third person, I guess.)


@justinmduke
me@jmduke.com