Code Reuse Is Overrated

Okay, maybe not. But bear with me. I want to invite you to stop thinking about what you’re doing as “code reuse” and start thinking about it as “design”.

The reuse mindset put blinders on you. It pulls you in the direction of eliminating redundancy in existing code. I.e., I have several functions with the same shape and I create a new thing with that shape and have my existing things refer to (and thus depend on) the new thing.

Reuse is often a good thing, but it’s not the only thing.

How might your thinking differ when your task is “design” instead? Design mindset is a more top-down way of thinking, more holistic. When I think about design, I think about what the right building blocks are for the problem at hand, and consider how they ought to fit together. Some of the tactics are similar, but the strategy driving your choice of tactics is likely to be different.