Why is tightly coupled bad but strongly typed good?

后端 未结 9 524
日久生厌
日久生厌 2021-02-04 13:30

I am struggling to see the real-world benefits of loosely coupled code. Why spend so much effort making something flexible to work with a variety of other objects? If you know w

9条回答
  •  既然无缘
    2021-02-04 13:51

    If you know what you need to achieve, why not code specifically for that purpose.

    Short answer: You almost never know exactly what you need to achieve. Requirements change, and if your code is loosely coupled in the first place, it will be less of a nightmare to adapt.

提交回复
热议问题