Lava Flow

This anti-pattern is also known as the "dead" code. It is most frequently seen in application level. Its usual drama is about irresponsible contribution and lack of documentation. Without those, new development was unsure whether to remove/update them. Hence, the best course of action is to leave it.

Given enough time, these dead codes piled up, ended up like lava getting cooled into stone/graphite: you can't remove them because it can destroy things somewhere; it serves no purposes at the same time.

Consequences

  • Large unused and unclear code fragments and variables
  • Undocumented complex, important looking classes or structures.
  • Need very large resources to back-trace each of the fragments for housekeeping.
  • demoralizes new developers.

Symptoms

  • When the library has released but the product specification is still using the legacy version.
  • When the commercial product quickly obsolete the older version so that the newer product sells faster and greater.

Causes

  • Development without thinking configurations.
  • Lack of configuration management.
  • Uncontrolled distribution of unfinished codes.
  • Lone wolf written code.
  • Lack of architecture knowledge and development (technical debt).
  • Repetitive development process.
  • Architectural scars (no auditing efforts).

Fixing Recipes

  1. Assemble a team to investigate these dead code fragment. Back-trace them to know their roles in the source codes.
  2. Revise the architecture.
  3. Refactor them accordingly. Remove when needed.