Code momentum

In computing, code momentum is the situation where large amounts of code dependency are repeated in programming code creating a stubborn dependency. That is a sort of momentum. The more things are done one way, the more definitely you're headed in that direction, and the harder it is to change course. Some claim that minimizing dependencies limits momentum and makes it easier to change course.

Code momentum is alleged to be an example of an anti-pattern.

Criticism

However, coding to an API with multiple implementations to choose from is not necessarily harmful. For example, JDBC is the de-facto standard for communicating with relational databases in Java (when not using object-relational mapping). Although using JDBC creates a dependency on JDBC, that is not necessarily a big deal - as opposed to using some non-standard, vendor-specific extensions or SQL syntax, which does create a dependency on one database and makes it harder to shift.

Moreover, trying to reduce external dependencies too much may result in Not Invented here syndrome, which can be counterproductive.

See also

Adapt to adapt for an anti code momentum checklist.

References