There are many approaches to this situation:
- Eat from a dirty dish, risking to get sick.
- Wash the dish you are going to use, and leave the rest unwashed. The rest of the dishes will be harder to wash later.
- Wash all the dishes regularly, so no piles of dirty dishes accumulate.
- Toss all the dirty dishes, buy new dishes or use disposable dishes.
- Hire a cleaner.
In this analogy:
- a dish is code
- a dirty dish is code with technical debt
- eating from a dirty dish is extending technical debt
- washing a dish is refactoring or cleaning up code
- hiring a cleaner is delegating the problem to some 3rd party.
- a dishwasher would be futuristic ai that does your job. that is what will end up happening.
Now, washing dishes is something that everyone benefits from.
- When this decision is delegated to more than 1 person, the result is: the volunteer's dilemma. If everyone competes by being a freerider/bystander, everyone loses.
- If there's only 2 people, the result is the chicken game. If both compete both lose.
The way you manage this situation is:
- Punish short-term thinking, reward long-term thinking.
- Create a code review process, a coding standard, and make people accountable for cleaning up their own mess.