The question is primarily to those who have already participated in large projects. We often hear that unnecessary dependencies are bad. I would like to understand what hinders the extra dependencies in the project. I came up with only two reasons:

  1. Search for errors. When looking for a mistake, there is a certain number of options for the cause of its occurrence. Theoretically, with extra dependencies, this number increases.
  2. Testing. With unnecessary dependencies, it is sometimes impossible to apply modular mock testing. Although this is not always the case, but only in extreme cases, when, for example, the model depends on the UI.

What other reasons exist that I have not yet encountered? I would like exactly the reasons, but not “well, this is not a very good style,” etc.

  • flexibility, kiss, code reuse, extensibility, etc. etc. In order not to list just say "bad style" - Zowie
  • I would like exactly the reasons, but not “well, this is not a very good style” and I would like to answer the question in more detail - user7389
  • What is the "extra dependencies"? - beardog
  • "extra dependencies" - a sign of poorly designed architecture. This delivers a lot of inconvenience with the support of the code. Especially if on the project staff turnover. the absence of clearly distributed responsibilities between classes leads to an avalanche effect — changing one leads to a change in the majority associated with it. readability of the code is reduced, which aggravates the problem with frame turnover. ps and also swear words become the most used pss in order to get the most detailed answer is better to read some book on the optimization / refactoring code - jmu

2 answers 2

Excessive dependence between application modules leads to very sad consequences when it is necessary to change something in the work of the program. If you minimize intermodular dependence, then it will be very easy to maintain and modify the application, with low labor costs. Well, you can use the modules in other programs.

Best the enemy of the good. Therefore, everything should be used in moderation, something that may work fine in one situation may not be suitable for another at all ...

    (Better than on the wiki, do not write)

    Tightly coupled systems tend to exhibit the following developmental characteristics, which are often seen as disadvantages:

    • It is usually the case that there is a change in one module.

    • Dependency module.

    • It would be possible to test a specific module because it could be included.