Avoiding Redundancy with Function Pointers
I am currently writing OpenGit, a BSD-licensed re-implementation of Linus Torvald’s Git (lower-cased going forward). This frequently involves reviewing git’s source code to understand how it works under the hood. One of the things I consistently encounter is git performing similar and sizable tasks in multiple different ways and places, resulting in redundancy and a higher maintenance cost.
In this brief entry, I will discuss a classic problem and how I solve it: When minor variants of a routine result in multiple implementations.
Read more...