4 ms·
> Also, I’d argue this barely qualifies for the boy scout rule: does migrating the code to a more modern form of itself count as leaving it “neater than it was”
by kelnos 2y ago
> Also, I’d argue this barely qualifies for the boy scout rule: does migrating the code to a more modern form of itself count as leaving it “neater than it was”?
"Barely" is an understatement. You just shouldn't do this as part of a big version migration. It's noise, and introduces more changes that could cause bugs, and then you end up wondering if the bugs were caused by the big version migration, or by all the little changes that were supposedly cosmetic.
Arguably you shouldn't make those types of changes on their own at all. If you're later refactoring the code for a "real" purpose, or making other type of changes in that area, sure, go ahead, the code that you're working on to their more modern forms. But otherwise they're akin to rewrites: the existing code works, and has been tested and debugged, and changing it just so it "looks more modern" is pointless.
- paltaie 2y agoAgreed. The challenge I had was that the juniors helping me out were obsessed with applying these low hanging fruit style modernisations because of an unqualified "it's better". I had to sit them all down and explain a variant of your point and the one another poster made about second system syndrome.