All code is throwaway code

This year, I’ve had two different occasions where I had to work with team members who had invested significant amounts of time into developing features which ended up not being included in our shipping product.  This wasn’t prototype code, this was code we fully intended to ship while it was under development, but chose not to for business reasons.

As I got ready to break the news to the team, I remembered the first time that happened to me as a developer, and how frustrated I was.  You think back on the weekends you worked to hit deadlines, the hours you spent trying to find tricky bugs, the wars you went to over design philosophy, and you wonder if any of it was worth it.

But I also thought of how my feelings on events like this have changed over the years, and I hope that I was able to help some of my team members, who were going through it for the first time.

While few people go into a project hoping to write throwaway code, in the end we hope most of the code we write gets thrown away.  Ever had to maintain decade-old code written by a team who has long since moved on?  Nobody wants to be held to task for the design, coding, and documentation mistakes they made a decade ago.  Eventually, you want your code to be retired, and the lessons you learned from it to be applied to new projects.

On the other hand, everyone wants to contribute to their team’s success, and investing weeks or even months of work into code which is pulled from the product seems to be the exact opposite of that.  The frustration is understandable.

But, stepping back a bit, the end result isn’t much different.  You (hopefully) enjoyed the work while you were doing it.  You did the work well, for the right reasons.  You made life easier for your colleagues, you kept your customer in mind, you did your best.  You were paid fairly for your time.  And, you learned things which you’ll take to your next project.

So the code isn’t running at a customer site somewhere … nothing else is different whether the code is thrown away after a decade, or after a month.

I’ve spoken with a few “seasoned” veterans about this, at work and in personal circles.  It seems like sooner or later, many of us arrive at the understanding that the journey is more important than the destination, even if strictly speaking it’s the destination that funds our paychecks.