from Hacker News

Pros/Cons of the "drive by" code fix?

by hlship on 3/19/24, 11:15 PM with 0 comments

A question for HN: I'm in the habit of making small changes, as I see them, in code - usually fixing documentation strings and comments, occasionally refactoring code or even adding missing tests.

These "drive by" fixes, as I call them, are often not related to why I've created a branch and PR on some codebase, they're incidental.

I feel like if I tried to put them aside and address them later, they would never get fixed. The work of tracking them, checking out a fresh branch, making those changes, and getting them reviewed, merged, and released - outside of "real work" on the codebase - seems too difficult.

This applies to many open source projects I work on, as well as many of my current and past companies' internal code.

So is this a common habit? Is it something I should embrace, or something I should avoid?