I agree with you, but the problem is that such codebases rarely exist in practice. This is partly due to laziness and time pressure. When high standards are not maintained or time becomes a constraint, developers start to make compromises in large codebases, such as placing or connecting functionality in inappropriate parts of the codebase. This is much harder to do when access is restricted by an API (contract) between teams, as it forces communication.
Additionally, if parts of the codebase are completely messed up, refactoring in large codebases can be extremely difficult due to complex interconnections with numerous other components. In contrast, with a microservices architecture, if you have 50 microservices and five are poorly designed, you can rewrite them from scratch while ensuring the new versions maintain the same API. This ensures that the other 45 services adhere to the API contract and cannot interfere in any other way.
I agree with you, but the problem is that such codebases rarely exist in practice. This is partly due to laziness and time pressure. When high standards are not maintained or time becomes a constraint, developers start to make compromises in large codebases, such as placing or connecting functionality in inappropriate parts of the codebase. This is much harder to do when access is restricted by an API (contract) between teams, as it forces communication.
Additionally, if parts of the codebase are completely messed up, refactoring in large codebases can be extremely difficult due to complex interconnections with numerous other components. In contrast, with a microservices architecture, if you have 50 microservices and five are poorly designed, you can rewrite them from scratch while ensuring the new versions maintain the same API. This ensures that the other 45 services adhere to the API contract and cannot interfere in any other way.