1

Suppose I have a function (or object or module) that is imported by 100 files, and that making a change in the function will affect all these 100 things that depends on it, possibly breaking them. What is the word for this situation?

1
  • There is no such thing as "too many dependants". If something provides useful functionality that is very widely used, there is absolutely nothing wrong with that fact by itself. It only becomes a problem when there is someting else wrong with that piece of code, such as bad encapsulation that makes it impossible to make needed maintenance changes without breaking the dependants. Jul 2 '19 at 20:41
4

Dependency Magnet

I do not know who invented that wording, but it was used in the book Clean Code - A Handbook of Agile Software Craftsmanship by Robert Martin and I wrongly assumed it'd be widely known and used.

3
  • While I understand adding the fluff, it would be better for other people who searched for this question if you would provide some "reasoning" or supporting materials. Jul 2 '19 at 14:13
  • I replaced my smart jibberish with actual information where I learned about that word.
    – Richard
    Jul 2 '19 at 17:12
  • Once again, Uncle Bob makes up random words that somehow make it into the programming lexicon. Jul 2 '19 at 19:22
3

This is a form of Coupling. Your function/object/module is widely used so externally visible changes will have a wide impact that may require massive rewriting.

Robert Martin explored this in his Clean Architecture book with the Stable Dependencies Principle: Depend in the direction of stability. Your particular cases is given in Figure 14.5.

enter image description here

So you could say that your function/object/module is "highly responsible" but I prefer to stick with "widely used" when talking to normal people. It seems to get the same point across without making people look it up.

1
  • Thanks. I think the programming world needs a word like "<adj> coupling" for this kinds of coupling, otherwise the bare word "coupling" is too broad and vague.
    – golopot
    Jun 30 '19 at 16:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.