In a nutshell, the lava flow anti-pattern happens when many programmers lead the development of an application, each of them trying to gradually change the technology the said application is using.
Here's a summary of the situation the blog post describes:
- Laurence starts the development of the application with the technology A
- Laurence finds another job, Bruce comes in. He tries to convince the management that technology B is better. He asks for time to be allocated for refactoring. But due to budget and time constraints imposed by the management, he ends up writing new code with technology B, and tries to refactor – bits by bits – the old code from technology A to B.
- Bruce finds another job, Ina comes in. She recommends technology C, ...
- and this goes on over and over again.
- At the end, the application is using technologies A, B, C, D, E, F. Because each programmer added their new technology, and tried to refactor the legacy code, but not all of it.
My question is the following, imagine what should have Bruce (the second programmer done) ? What is the best practice here? I understand that this depends on the situation, the technologies involved, and other factors... But is there a good rule of thumb?
Should you embrace legacy code? Should you block the development process, and say "I can't do anything without any refactoring"? Is the lava flow anti-pattern not so bad after all?