Code messes are similar. Sweep them under a rug or toss them in a closet and your code will look clean, just like your counter looked clean while those two dishes were in the sink. And like the sink you can quickly get to the point where those closets are scary to open and no one wants to walk on that rug because it makes weird crunchy noises.
So how does one leave ones messy code "on the counter"? Well in my "writing C with vi" days I actually outdented any code that I didn't consider clean/good/permanent. Like all the way to the left, regardless of where it would naturally be indented at. It stuck out like a dirty mug on clean granite, and no one (importantly including me) failed to notice it.
With modern IDEs and auto-formatting and the somehow unavoidable use of Python I no longer use that technique, but I will comment any such code liberally with #HACK or #TODO or similar
If you live by yourself, you can be as messy as you want. It's only a problem if your mess becomes a biohazard for your neighbors that you have to take care of it. Otherwise, if you're happy with your mess, that's fine.
If you live with other people, your mess in the common area becomes their mess. That's a problem if other people do not like your mess. There needs to be agreed upon standard by those living together.
Eventually, the mess will inhibit your ability to work productively regardless of the situation. I guess you can always throw out dirty dishes and buy new ones, but there is a cost to bear.
You can't discount people who keep code clean, modular and simple. It's not an easy thing to do unlike cleaning your house. It just takes one's will to clean the house but when it comes to keeping your codebase clean, it's much more than just will.
Sound knowledge of software architecture and design principles is required to write and keep your code clean and unfortunately, the number of people with this knowledge is very small in most teams and sometimes there's none.
Also, it's not okay to be messy unless you are working on a school/university project.
And between say 'medicine' and 'refuse collection', standards of hygiene and priorities can and will be wildly different.
Let me put it this way. I've seen no relationship with code purity and a happy client
No? Would you say then that you don't care if your food comes out slowly or gives you food poisoning?
You care about the result, but you trust it to someone else.
It is a Chef's responsibility to maintain the mise-en-place and food safety to a degree which enables him or her to keep delivering meals quickly and without salmonella.
It is an Engineers's responsibility to maintain the code clarity and tests to a degree which enables him or her to keep delivering improvements on business needs quickly and securely.
I find a lot of a certain kind of sw person who need analogies to make their mental model work. It never did for me
This is just it. It's expensive to organize things.
Bad architecture is worse than no architecture. It take time to build, then more time to tear down.
How do you organize with no experience? A mess already holds a structure. It can be evolved into the right structure. But if you adopt the wrong structure too early, you're stuck with a bad system that has to be destroyed and rebuilt.
Software architecture isn't like that at all. Developers routinely have massive fights and disagreements over whether something is clean or not. One person's clean is another person's over-engineered monstrosity.
This changes the equation quite a bit. In any sufficiently big team either one person has to be top dog and enforce their personal perception of clean on a perhaps unwilling team. Or you have to flex and tolerate multiple competing definitions in a codebase, which if you have "clean freaks" in the team can lead to constant pointless refactoring and rewriting.
Definitely the way to go. It's not a problem until it's a problem.
I see it as a problem waiting to happen until it happens.
The dropping of standards is always going to make things a bit easier on yourself but if there isn't really much more to it than that, is proclaiming "It's okay to be messy" really a good thing?
I don't think(I might be wrong) other engineering fields can get away so lightly with such attitudes, why do you think we can? Particularly in light of so many security disasters unfolding around us. How can you justify an attitude that seems to move in the opposite direction of where many believe we should be heading, i.e. tighter control, more strongly enforced standards and a distancing from the 'move fast, break stuff' ethos
Many of us are familiar with that balance in our daily lives; e.g. we don't mop the floor so clean we can eat off it. But code is often continually polished, refactored, documented as soon as there is the slightest smell.
We do keep tidy enough. The standards for office cleanliness never qualifies to surgery standards, and yet a lot of people like to compare their code to medical device safety levels.
Besides that, there is a clear structure to mess. Too much or too little order and you lose control. The right amount will give you the correct structure.
Treat code mess with the same techniques you would treat RL mess. Sometimes you sweep it under the rug. You can toss it in a closet or attic. You can buy a shelf or box and toss everything in there.
You can clean it up seasonally, like set aside a sprint for it.
Some kinds of messes are hazardous and absolutely should not be tolerated - this is similar to leaving milk out or trash piling. Many people make this mistake of assuming that because some messes are very dangerous, all of it is too.
Most messes will slow you down, but cost more to clean up. Overall, I've seen documentation do more harm than help - it's often faster to interrupt a colleague doing something than for that colleague to spend weeks documenting and updating documentation on something that gets thrown away.
Some will take more time to fix later than now - this is what people mean by tech debt. But it's less common than it seems.
With a lot of mess piles, the important parts float to the top and the less important ones sink at the bottom. God classes are mess piles.
Once the mess becomes a burden, it's a good time to clean up.
You may need a few janitors and landscapers, especially for a large code base.
Some people place much higher priority on cleanliness than others. Be respectful of them but you don't have to be like them.