Junior
What is coupling in code?
sobes.tech AI
Answer from AI
Coupling in code refers to the degree of dependence between modules or components of a program. The higher the coupling, the more modules depend on each other, which complicates maintenance and modification of the code.
Example: if one class directly uses the internal details of another class, this is strong coupling. To reduce coupling, principles of modularity, interfaces, and dependency inversion are applied.
Low coupling is a good practice, making it easier to test and modify parts of the program without affecting others.