3 ms·
Rewrite and strongly focus on the improved parts. Never say or suggest that the old code was "bad". Besidse, are they really bad? It is working code, isn't it?
by qznc 14y ago
Rewrite and strongly focus on the improved parts. Never say or suggest that the old code was "bad". Besidse, are they really bad? It is working code, isn't it?
Example, "Enumerate FooKinds at a single point" instead of "Removed code duplication".
This is a social problem, so the solution must be social as well. Careful communication is the key.
Communication also means to listen. In this case, listen to your boss. Sometimes there are good reasons for "bad" code. Can you proof that your refactoring is an improvement? In most cases no, because many things are subjective. You might decouple components, which is good from a software engineering perspective, but insert a redirection mechanism, which makes it less simple.
- jrdev 14y agoIn this particular case, the changes are all trivial improvements, there is no complexity introduced, just needless complexity removed, with better code construction, as the previous code is actually impossible to extend. The code is similar to something you would expect to see from a brand new developer, common mistakes made due to a fundamental misunderstanding of the core language functionality.