Your code is like a home. If your home is messy, it changes how you feel in the space. If my home is messy I feel weirdly ineffective and sloppy. Tidying up makes me feel empowered and capable.
Don't leave mess alone. Tidy it up. A codebase you actively nurture will make you feel like change is easy. Its well worth the time investment.
On the other hand, if you spend all your time tidying and cleaning, you never get anything done.
There is such a thing as "too tidy", and while everyone disagrees on where the point is, companies tend to be very good at forcing that point through constrained resources.
I don’t think many projects are at much risk of that. Most professional code I’ve seen is a barely functional mess. There is such a thing as “too tidy”. But I can count the number of times I’ve seen it in my career on one hand.
I can not count the number of code review comments about missing periods at the end of comment lines on one hand. If you include comparably worthless comments, I can use the binary system and will still run out of hand...
Ah that’s fair. I have nothing but contempt for those sort of comments too. They feel like a sort of petty tyranny of small scale thinking. Good, clean software usually needs to go through a chaotic messy period to find its identity - and find what the core abstractions really are. Like, first get the big details wrong, then iterate until you get the big details right enough. Then focus on the medium details, then the small details. Then release. Doing that process out of order is at best a waste of time, and at worst a massive distraction. Our attention is our most precious commodity as programmers. Wasting it inappropriately is criminal.
If you want to move deck chairs around on the titanic, at least have the common decency not to drag the rest of us into your orbit of BS.
And the best way to manage your home is to separate the tasks into tidying, organising and cleaning. 3 separate and distinct actions. The same applies to code and projects.
Maybe I understand it wrong, but I can't agree with this analogy as is...
An organized home means to do things right away. If the laundry is done and dried, then I'll put them away (organize them) immediately. I don't wait for other things (eg. the dishwasher) that need to be tidied up. If I service my bicycle in one room and leave a mess, then I'll clean it up right away and don't necessarily include other rooms in that cleaning cycle. But on the other hand, if I spot some dust in one room, I'll just grab the hover and go through the whole flat.
Actions can be separate, and so can scope and effort.
I feel a house is best managed when effort and scope are low, so it is in my best interest to keep it that way. If my task becomes the action to tidy my home, then I know something went wrong.
Don't leave mess alone. Tidy it up. A codebase you actively nurture will make you feel like change is easy. Its well worth the time investment.