Why are circular references in Visual Studio a bad practice?

后端 未结 8 2032
囚心锁ツ
囚心锁ツ 2020-12-05 23:33

Why are circular references in Visual Studio a bad practice?

First, I will describe an example of how this can happen using C# in Visual Studio, since VS will typi

相关标签:
8条回答
  • 2020-12-05 23:59

    circular dependencies are bad because:

    • project A references project B
    • when project B changes, project A needs to be rebuilt
    • now if project B also references project A
    • then when one of them changes, the other one needs to be rebuilt
    • which causes the other one to need to be rebuilt
    • which causes the other one to need to be rebuilt
    • etc.

    this is potentially an infinite-loop in the build process

    0 讨论(0)
  • 2020-12-05 23:59

    If you're having trouble convincing your "pragmatic" colleagues that this is a bad practice, offer a pragmatic solution: Remove these circular references and build times will go down since loads of unnecessary rebuilding will be avoided.

    0 讨论(0)
提交回复
热议问题