Is all code, written by others, bad legacy code?


* Many times new, especially medior (with 2-3y of experience) developers start in the project, and in their newly learned prowess they think they the know it all and think that all current code is legacy code.
* A common trait is that they look the code, written by others, and think it’s bad. They want to rewrite everything from scratch, especially since they don’t understand the style, programming language, requirements or design of existing system, and even don’t want to study it. They have just learned one tech well (watched a few youtube videos, and read a few blog articles about it), and want to apply this one tech to all solutions.
* As the first thing, they start removing of features that they see ”unnecessary”.
** However, since most systems are so complex, it’s very arrogant to claim as a new developer in the project that you would have any idea what is necessary and what is not regarding to legacy code
** Secondly, in Extreme Programming, there is a sacred agreement that Business makes decision on Requirements, and coders have full control of design. By removing ”unnecessary” features, you make decision on behalf of the Customer. Think what happens if the Non-Tech Customer would break similarly his/her oath, and start doing design decision in the tech realm? See https://wiki.c2.com/?CustomerBillOfRights and https://wiki.c2.com/?DeveloperBillOfRights
* To prevent this, let’s use Code Review and Unit Testing. Let’s move the Requirements to Technology Structure by writing them as code. Let’s enforce passing of unit tests.
* In Tests we Trust.