2 ms·
I have a knee-jerk reaction when most people say "refactoring". In many cases they're talking about a different, arbitrary way to deduplicate an implementation,
by karmakaze 4y ago
I have a knee-jerk reaction when most people say "refactoring". In many cases they're talking about a different, arbitrary way to deduplicate an implementation, usually in a mindless/mechanical way. If you can't name the 'factor' that you're separating and that factor doesn't have business or conceptual cohesiveness, then you're just pushing bits around for someone else to want to do it differently. So now when someone says it, I always ask what do you propose to factor and why?
- rileymat2 4y ago> usually in a mindless/mechanical way Loaded language not withstanding one of the premier books is all about “mindless/mechanical” changes to structure without changing behavior. It is about step by step safe microchanges. This might be the biggest difference between refactoring and rewriting. But you are right it is pushing bits around with no behavioral change. That’s the point. The open question is if this newly refactored software is more maintainable, more understandable, easier to change in the dimensions it will mutate in the future. Often the answer is “no” and you are right to be frustrated.
- karmakaze 4y agoThe execution (how) can be 'mechanical' but the goals and choices (why) should be thoughtful. If it's simply deduplication there is no thoughtful why necessary, although in the worst cases abstract machinery is created for the purpose. You're right about my misconstruing 'no behaviorial change' as that is always a requirement. There should however be a change in where the seams of the implementation lie which better suits the direction of expected changes.