Boat Anchor

This is when you inherit a lot of code, and all of it is useless for the task at hand. I have seen it after company mergers and acquisitions, when two company systems are eventually merged into one. Or when you get code without a database, part of the logic lives in the database — and good luck gathering requirements and trying to modify it.

In short, you can end up with something that is not just unused but actively in the way.

Symptoms

  • Whole modules that no code path reaches.
  • "We don't know what this is for, but deleting it is scary."
  • Logic is partly in the application, partly in stored procedures and triggers.
  • The repository keeps code of already closed projects.

Why it happens

Most often after company mergers, a change of project owner, or migration to another platform. The code is no longer needed, but nobody deleted it.

Example

The "bad" version: the service contains a module of an old integration that is no longer called but drags in dependencies and confuses searches:

# legacy: integration with a decommissioned gateway, called by nobody
class OldGatewayClient:
    ...

The "good" version: the code is removed entirely, a single responsibility:

class NewGatewayClient:
    ...

How to fix it

  • Cut such code out entirely as soon as possible — it lives on in version history.
  • Analyze coverage (tracing, logs, call search) before deleting.
  • After merging systems, merge functionality, not code: rewrite what is needed and don't drag along the rest.