Deleting Your Way to Better Code

Connor Shaughnessy
FordLabs
Published in
3 min readFeb 7, 2019

I come to the technology space by way of the humanities, specifically literature. Sometimes people ask me how I got into something so different from what I studied, but I question how different they actually are. Writers and software engineers are both experts in one or more languages. They’re both valued for their expressiveness in those languages. The job, in either case, is to put symbols together in *just* the right order on behalf of a publisher.

We just happen to call publishers “tech companies” sometimes now.

Given these similarities, I hope you won’t look down your nose at an old piece of writers’ advice as it applies to tested software:

“Murder your darlings.”

It sounds shocking, but is uncontroversial in the creative writing community — the saying doesn’t actually mean you should go do crimes (although the angst might help your art); instead, it just means to get attached to self-improvement rather than attached to any particular part of your work. So that you can modify your work. So that you can erase your work. Can “murder” it, but for its own sake and yours, somehow. Writers love dark jokes.

Erasing work feels icky, though. It doesn’t feel like engineering. It feels at once like both an admission of fault (‘If it was wrong, why was it built this way in the first place?’) and a step backwards (‘We used to have a broken machine, now we have no machine at all’). So why am I such a big fan of erasing my work? Am I a nihilist? Or one of those who just wants to watch the world burn?

Let’s assume the latter. Who do you think sets more fires in the US yearly — arsonists or foresters? Wait, don’t touch that search bar — it’s foresters. They’re looking to burn the right stuff at the right time to ensure it comes back stronger later. And you should be too.

For all of the same reasons that agile development is practiced at all — unknown unknowns, a rapidly changing product space, etc. — it is useful not to be tied to your current implementation of a feature or idea. We all know this and many of us have internalized it in our careers, but we internalized throwing away work being equal to waste much earlier — in kindergarten or thereabouts. However, fighting back against our instinctive distaste can have some advantages. For your consideration:

  • The point of the software was never the software. If you can build something that serves the same human needs with less code, you probably should. Yes, your method is beautiful; no, we’re not artists of the beautiful. We’re craftsmen of the useful.
  • Your tests will be really great if you are actually using them as a spec. Plenty of shops talk about test-as-spec, but how do you know that isn’t just an excuse to avoid writing specs? You re-write your production code based on the tests every now and again, is how.
  • You’re probably better at this than you used to be. Sure, from a philosophical perspective life isn’t an upward trend, and at some point we are all as good as we’re going to be and getting worse. I don’t think I’m there yet, though, and statistically you probably aren’t either. If you give yourself permission to delete yesterday’s work, you’re effectively giving yourself permission to be your best self today.

--

--

FordLabs
FordLabs

Published in FordLabs

FordLabs is a software incubation group within Ford Motor Company, whose mission is to develop innovative software through human centered design, lean validation, and XP software development.