7 Decomposition
No one deliberately decides to write legacy code. Code bases gradually deteriorate.
Why is that? Everyone seems to understand that a file with thousands of lines of code is a bad idea; that methods spanning hundreds of lines are difficult to work with. Programmers suffer when they have to work with such code bases.
If everyone understands that, though, then why do they allow the situation to become so bad?
7.1 Code Rot
Code gradually becomes more complicated because each change seems small, and no one pays attention to the overall quality. It doesn’t happen overnight, but one day you realise that you’ve developed a legacy code base, and by then, it’s too late to do anything about it.
At the beginning, a method has low complexity, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access