24 Comments

I find a lot of times there's push back from developers who don't TDD, and they definitely don't do incremental test and commit.

I find tidying to be entirely about economics. If code is not getting in the way of my work I just don't touch it. Getting in the way could be where I need to understand it to make another change, in which case I may refactor it. It could be where it's core to what I'm changing, and it's difficult to read, inflexible, or whatever, and that too gets in my way. But if it ain't getting in my way, I usually leave it alone. I know that sometimes people like to tidy just because something looks bad, and I've seen projects take a very long time because of that. Code *always* looks bad, and you can actually over do it. :D

Expand full comment

This will not work well. When you replace the code, you will need the experience from the previous refactoring. That will make a difference.

Expand full comment

What are the strategies to also leave the opponent with a feeling that we are not evil or stupid?

Expand full comment

“Don’t tidy that. We’re about to replace it.”, “Don’t tidy that. It won’t make any difference.”

Why were you looking in that code in the first place?

I will assume there was a good reason, that you needed to understand something in there, or that you needed to modify it, not that you are just trying to "clean something somewhere".

Here one point I see, is even if it will have no impact to the outside, the customers, the product, may be thrown away tomorrow. It will however have an impact on myself who is currently working on it (and maybe my colleague wo will need to look at it tomorrow).

I try to clean my workplace before changing something and sometime clean my kitchen before cooking.

I use tidying as a tool to better understand a big chunk of code. The process of understanding, building small blocks I can abstract in my brain, is a similar step that I am doing when tidying up. The rest is just some keystrokes to move lines around.

I see the TF? process also as a step to make recognized that your (and team) well being matters.

Expand full comment

I've seen something related in a discussion under a pull request at work just today:

- A: ...while you're at it, this part could use some tidying.

- B: Oh, this code was already there, it's in the diff just because of a change in formatting (or something).

- A: Well, OK, I guess...

This type of pushback seems to me somewhat harder to reject.

And of course, it doesn't get any easier to reject it next time.

BTW, I can't help to keep reading "TF?" in my mind as "the f***?" - but maybe this is by design?

Expand full comment