John Carmack on Parallel Implementations (2018)
I&#x27;ve seen a couple of comments here talking about feature flags and I don&#x27;t think that&#x27;s quite what Carmack is getting at here.<p>It seems he&#x27;s talking more about refactoring&#x2F;optimizing&#x2F;debugging working code rather than adding new features. Then the old version of the code becomes a point of reference against which you test your new implementation.<p>Once you are very confident that your new implementation is no worse than the old implementation you have two choices.<p>1. Leave your old implementation around as a reference implementation, but mainly use your new implementation. This is useful if your old implementation is functional and readable but slow and your new implementation is less readable but faster. This helps other developers understand your new implementation.<p>2. Remove your old implementation altogether and just keep your new implementation in your codebase.<p>Either way the thing Carmack is advocating for is having an extended period of time where the two implementations coexist, even though one of the implementations is &quot;redundant.&quot; He is explicitly advocating this despite the fact that you could in theory just retrieve the redundant implementation from version control and not have to &quot;pollute&quot; your codebase with a redundant implementation.