Junior — Middle
Explain what is meant by coupling in the context of programming and system design.
sobes.tech AI
Answer from AI
Coupling is the degree of dependence between modules or components of a system. The higher the coupling, the more one module depends on another, which complicates support and modification of the code.
Ideally, low coupling is desired so that modules are as independent as possible and changes in one do not affect others. For example, if class A directly uses the internal details of class B, this is high coupling. If A interacts with B through abstractions (interfaces), the coupling is lower.
Low coupling increases flexibility, testability, and makes system maintenance easier.