News for hackers. Stuff that matters.
Re:Visual Git by dgb23 on Monday November 01, 2021 @05:20AM (#29064510)
I tend to overthink and hyperreflect when it comes to organisation and structure. Most of the time this doesn’t really help. One of my goals in the last year or so was to reduce that.

A very simple but effective thing I started doing is writing „cleanup“ comments. Duplication, ad-hoc coupling and such.

In the comments I sometimes decribe how one could go about it, so I remember later what the issue might be.

There are several benefits to this. For one, prioritizing what matters in the moment. Letting things unfold for real, so the right structure becomes more obvious later. Also it sometimes sparks little discussions that are useful and reveal a pragmatic way forward.

Re:Visual Git by berkes on Monday November 01, 2021 @09:20AM (#29066326)
And a third benefit: leave refactoring to the time when you have enough information to refactor.

As c2 wiki has it[1]

> * The first time you do something, you just do it.

> * The second time you do something similar, you wince at the duplication, but you do the duplicate thing anyway.[...]

> * The third time you do something similar, you refactor.

E.g. I've seen a lot of Incidental Duplication being refactored out, leaving the code apparently cleaner, but in practice, really much worse.

[1] http://wiki.c2.com/?ThreeStrikesAndYouRefactor

Re:Visual Git by blowski on Monday November 01, 2021 @09:57AM (#29066657)
My theory as to why this happens.

1. You write some code.

2. You write a duplicate of #1.

3. You write another duplicate of #1, so you should refactor. But the PM doesn't understand why you're changing the code you made in #1 and #2 as part of ticket #3.

So the jaded devs are certain the duplication will occur, but believe their choice is either to pre-emptively fix the duplication at #1, or never to fix it at all.

Re:Visual Git by berkes on Monday November 01, 2021 @11:14AM (#29067749)
> But the PM doesn't understand why you're changing the code you made

If that is the case, the PM does not understand red-green-refactor, always-refactoring, or even just plain refactoring. I'd say the PM doesn't even understand the idea of technical debt, in that case.

The problem is certainly the PM's disconnect to how to keep a codebase (and their team) sane in the most common programming practices. And not the refactoring itself.

Re:Visual Git by blowski on Monday November 01, 2021 @02:00PM (#29070415)
I agree with that assessment on the surface. But it's a sign of a generally unhealthy team, not just a poor PM (although the poor PM might be the root cause).