| ▲ | cassianoleal 7 hours ago | |
That is the flip side of what you're arguing against, and is also very typical junior behaviour that needs to be corrected against. Tech debt needs to be dealt with when it makes sense. Many times it will be right there and then as you're approaching the code to do something else. Other times it should be tackled later with more thought. The latter case is frequently a symptom of the absence of the former. In Extreme Programming, that's called the Boy Scouting Rule. https://furqanramzan.github.io/clean-code-guidelines/princip... | ||
| ▲ | traderj0e 6 hours ago | parent | next [-] | |
The Boy Scout "leave it better than you found it" is a good rule to follow. All code has its breaking points, so when you're adding a new feature and find that the existing code doesn't support it without hacks, it probably needs a refactor. | ||
| ▲ | ramesh31 2 hours ago | parent | prev [-] | |
Indeed there's a distinction that needs to be made here between "not refactoring this code means I'll need to add hacks" and "Oh I'll just clean that up while I'm in here." The former can be necessary, but the latter is something you learn with experience to avoid. | ||