Dependency avoidance in code

Dependency avoidance in code

Jeff writes:

I’m not against dependencies. Everything software developers do is one giant string of dependencies. I’m a pragmatist. Strive to make your dependency stack as small as you possibly can.

If you take dependency avoidance too far you might get the Lava Flow anti-pattern:

As we delved into it, we interviewed many of the developers concerning
certain components of the massive pages of code printed out for us.
Over and over again we got the same answer, "I don’t know what that
class is for, it was written before I got here." We gradually realized
that between 30 and 50%
of the actual code comprising this complex system was not understood or
documented by any one currently working on it. Furthermore, as we
analyzed it, we learned that the questionable code really served no
purpose in the current system, rather it was mostly there from previous
attempts or approached by long-gone developers. The current staff,
while very bright, was loath to modify or delete code that they didn’t
write or didn’t know what it did for fear of breaking something and not
knowing why or how to fix it.

Leave a Reply