News for hackers. Stuff that matters.
Re:That won't scale Or present cost vs. future value by rtheunissen on Monday April 24, 2023 @03:37AM (#35684705)
"Bend" is not a good description of the intention here. Good code should be easy to test effectively and interfaces are a common way to achieve that. We should absolutely design our code with testing in mind.

For example, you have a repository for some entity as a dependency of a service and you would like to test some behavior of the service when the repository fails. In this case, the service can depend on an interface of the repository instead and the test can create a stub that implements that interface, whereby you can simulate the error. If the service depended on the actual repository, this becomes very difficult to do.

Re:That won't scale Or present cost vs. future value by agalunar on Monday April 24, 2023 @06:29AM (#35685771)
> Good code should be easy to test effectively

Can you explain why this is? or maybe more specifically what you mean by this.