|
|
|
|
|
by dbmikus
2476 days ago
|
|
I don't think the OP meant "don't touch old code", but this sentence, to me, implies that "reasons" means good reasons: > There are reasons for every code and every guard that exists in production. Sometimes the reasons are not good ones. Maybe that's exactly what the author meant. The rule doesn't read like that to me, though. And yeah, if you're rewriting something, don't rewrite the whole damn thing! Good code is modular and you should be able to pick it apart and replace components that are causing problems. If it's not causing a problem, don't rewrite it... However if you're going to be adding features to a section of code (or otherwise working on it a lot), it's a good time to try to understand if you can do a bit of refactoring along the way to clean it up. By default, all code gains code smell over time and also becomes more robust. It's a tight rope to walk. |
|