Re:Uncle Bob and Silver Bullets (2017)
by im_down_w_otp on Monday July 04, 2022 @12:26PM
(#31978806)
Is that last paragraph actually a thing? Yikes! That sounds like the kind of advice one would give if they've only ever dealt with toy problems.
[ Parent
| on HN ]
It's one of his solutions for refactoring long methods that operate on more than one variable, so that simple "extract method" refactoring isn't feasible.
He says to turn the function into a class and local variables into private fields. So that you can split the function into small methods that operate on these private fields. I used it a few times in a company that had strict "no Sonar warnings" policy. But I hate the resulting code much more than the initial code.