"It works - do not touch." Should I break the rules?
There was very little opportunity to introduce users into the context before voting. Thanks! So
When working with old legacy code, sometimes there are quite problematic areas that there is a desire to rewrite / fix / redo, but there is no such possibility. This code may be with errors that have not been fixed for years and have to be put up with. What to do with such code?
There are all sorts of problems. Starting from problems with readability \ logic, ending with real errors, memory leaks, deadlocks.
They try not to fundamentally change such code; only local problems and errors are fixed. The rule "works - do not touch" in all its glory. On the other hand, if you rewrite or correct this code, then life will become easier for everyone, but problems appear:
- No one understands how changes will affect the entire system as a whole;
- The probability of making new mistakes is very high;
- A period of code stabilization appears (as with the new code).
I hold the position that the code must be constantly developed and improved. To transfer the old sections to the rails of new technologies as soon as this becomes necessary. That is, if there is a problem or need, then you need to fix the code, and not study the workarounds (idealizing, often backward compatibility is a limitation). Of course, instability appears in the system for some time, caused by the possible introduction of errors, but for this there is continuous integration, testing, release of versions.
One of many examples.
Only registered users can participate in the survey. Please come in.
What are you doing with this code?
- 17.6% We don’t touch, it works 263
- 23.8% Ruthlessly Eradicate 356
- 54.4% We make changes when necessary 812
- 4% We do not have outdated code 61