Introduction
There was a lack of the ability to put users in context before the vote. Thank! So
Preamble
Working with the old inherited code, sometimes there are enough problem areas that have a desire to rewrite / correct \ redo, but there is no such possibility. This code can be with errors that have not been fixed for years and have to be put up with. What to do with this code?
There are all sorts of problems. Starting from problems with readability \ logic, ending with real errors, memory leaks, and mutual locks.
Such code is tried not to fundamentally change, only local problems and errors are corrected. The rule "works - do not touch" in all its glory. On the other hand, if you rewrite or correct this code, then it will be easier for everyone to live, but problems arise:
- No one understands how changes will affect the whole system;
- The likelihood of introducing new errors is very high;
- A period of stabilization of the code appears (as well as with the new code).
')
I adhere to the position that the code should be constantly developed and improved. Old sites transfer to the rails of new technologies, as soon as the need arises. That is, if there is a problem or necessity, then you need to correct the code, and not study workarounds (idealizing, often the backward compatibility is the limitation). Of course, there is instability 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
HTML is generated in the code by calling a certain printf. With that, with a wild mixture of flag logic “if such and such a flag is set and this number is more than 1234, then we derive ...”. It also displays javascript based on the same flags. TODO has been worth “getting rid of this nightmarish logic” for many years, but no one fixes this patch. It turns out that it forms not entirely correct HTML and it is necessary to add new logic, somewhere in the middle of this section.