An old coworker of mine would spend an hour or two each week cleaning up warts or dead code in the codebase we worked on. Some weeks it would be taking on that refactor that would make the code more readable. Some weeks it would be fixing that silly edge case bug that only two users had reported over the last 12 months. He called it "gardening".
Sometimes a garden fills up with weeds, and just needs an hour or two of someone pulling them up to make things pretty again. Other times it's applying fertilizer to the garden so that it can grow healthy and strong. In a codebase, gardening could be updating a dependency, or fixing that nagging warning that keeps popping up in your logs. Gardening could be taking a look at a flamegraph or stacktrace to figure out if there's a hot path that's worth optimizing.
Gardening is not to be confused with boyscouting in a codebase. Gardening is intentional, going in with the intent of pulling up weeds. Boyscouting is a by-product of some other change you're making, doing a refactor in favor of some feature you're building. I'm also happy to leave Uncle Bob and his terminology back in 2009.
Gardening means getting your hands at least a little bit dirty. It's shutting off Slack notifications for an hour or two, opening your IDE and working on some code in earnest. It's not something you need to ask for time to do, or something that your manager will ever tell you to do. It's about caring for your codebase, since you're living with it day in and day out.
Fridays are great days for gardening in your codebase. An hour or two to close out the week so that when you get back to your codebase on Monday, the weeds are a little less tall than they were last week. Maybe pull a few weeds from your garden today before the week is over.
