Shipit of Theseus

When all the code has been rewritten, is it still the same product?

Refactors. If you’ve worked in the same codebase for long enough you will have experienced one. Or two. Three? Maybe you’ve lost count.

Maybe you started by bringing the frontend up to the current Twitter-driven JS trend. Then wrote a new API namespace to feed it the data. And maybe as the product and feature set grew, there became a need to make it more modular and Composer packages seem like a good idea. The cowboy code you onboarded into isn’t PSR-4 compliant, and over time all the features get re-written.

And so on.

All of the code is different than when you started. It can be said to be better; Testable, readable, maintainable, documented.

Yet the features it provides end users are the same.

Is it still the same product? I find myself thinking about the ship of Theseus.

The ship of Theseus is a thought experiment that raises the question of whether an object that has had all of its components replaced remains fundamentally the same object.

A software product, just like a ship, is not just one thing. But to answer the question, a thing needs to be defined!

Let’s use Aristotle’s four causes to explain “what is a software product?”:

The material cause: “that out of which”
This is the code that is written. The frameworks or libraries used.

The formal cause: “the form”
I think of it as the UX. How it looks visually and how users interact with it.

The efficient cause: “the primary source of the change or rest”
These could be the developers. The people behind the thing. Or maybe the product’s name.

The final cause: “the end, that for the sake of which a thing is done”
I think of this as the value it provides the end user. Like how an analytics product helps them be informed of traffic to their site, and how a caching product makes their site faster.

A refactor, by definition, does not change the external behavior of the code. In a pure sense, we can say that the only thing changed is the form.

Of course many software products evolve beyond pure refactors and the material cause. UI, UX, rebranding, new staff, and so on.

I think it’s the final cause that matters most. It’s the value it provides that defines the product.






Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.