How to Add a Feature (Cleanly)

Every week in my Tuesday Lunch & Learn livestream, we look at a useful software development skill, define a challenge related to that skill, and solve the challenge live. This week, we’re adding a feature.

That’s not as simple as it sounds. Whenever you’re working with code you’re not familiar with—and in professional software development, that happens pretty often—the code’s a black box. So the question becomes, where do we add the new feature we’re about to add?

One of the things that separates better code from not-so-better code is how much attention people put onto understanding the design of existing code. It’s tempting to just find the existing behavior, make the minimum change needed to get your new feature working, and call it good. But that leads to technical debt. How do we take this black box, understand where the feature we need to add should live, and then implement it really cleanly in a way that improves the design?

To follow along, download the code from GitHub and check out the 2020-06-30 tag. To see the final result, check out the 2020-06-30-end tag or view it on GitHub.

Visit the Lunch & Learn archive for more.

If you liked this entry, check out my best writing and presentations, and consider subscribing to updates by email or RSS.