Do you schedule time and tasks for refactors?
Christian Vasquez Aug 8
This evening, I sat down to read on some of Uncle Bob's tweets and they are quite interesting, but one of them stood out for me:
Uncle Bob Martin@unclebobmartinThe word “refactoring” should never appear in a schedule. Refactoring is not a story or a backlog item. Refactoring is not a scheduled task. Refactoring is immediate and continuous. It’s like washing your hands in the bathroom. You always do it.11:23 AM - 31 Jul 2018
And I can totally understand what he means, but I recently started working on a project that is so tangled that it was actually slowing us down. No matter your seniority, you would find yourself increasing the "WTF per minute" counter constantly while working on what seemed like a basic task.
In case you may wonder what the "WTF per minute" reference is about, the following image should help you out:
Which led us to speak to our manager and try to convince them that if we kept going that road we would make our lives worse with each step we take.
So, that resulted in a bunch of tasks that had to be estimated, divided into multiple devs in order to reduce the overall time it would take (as long as they could be worked in parallel) and blah blah blah.
This meant that we would have to spend at least 1-2 months putting everything on hold until we could refactor our code to be easier to manage, for both experienced and unexperienced developers.
Personally, I find that Uncle Bob's opinion should be the way everyone should think, but it should not be written in stone. Depending on how critical or big the refactor may be needed, you may need those refactoring tasks to be tracked.
Other opinions found in this tweet thread:
Joseph Short@josephpshort@phill_steele @unclebobmartin That's the exact reason it should be a separate task; the product owner should approve all work. This approach allows engineering teams to spend money on items that may be better spent elsewhere. I agree with the original premise, if you're doing TDD. Not every shop does.22:56 PM - 31 Jul 2018
Which was replied with:
Monadic Paradox@therealtruenerd@JosephPShort @phill_steele @unclebobmartin I disagree with that. The patient doesn’t tell the doctor the diagnosis or treatment. The product owner doesn’t tell the programmer how to do her job. No need for approval to do things right (I wouldn’t ask for it)12:45 PM - 01 Aug 2018
And then Uncle Bob added:
Uncle Bob Martin@unclebobmartin@therealtruenerd @JosephPShort @phill_steele Right. The product owner does not approve all work. Such a notion is absurd. “Mr. Product Owner, I need to type a semicolon now, do I have your approval?”
Product owners decide the priority of features. The do not approve work.12:57 PM - 01 Aug 2018