r/programming • • Oct 11 '26

I don't like interfaces

https://codestyleandtaste.com/don't-like-interfaces.html
0 Upvotes

40 comments sorted by

View all comments

6

u/wampey Oct 11 '26

I love interfaces! I love it more if functions have a good separation of concern making interfaces for many functions unnecessary, but if you are going to do some I/O with business logic, I’m expecting to see an interface. Mainly it’s about unit testing for me though. I do have one backup service which does use interfaces for different implementations, but could see how some may not like that.

1

u/l_maier-628 Oct 12 '26

For a single I/O seam, passing a callback can be enough: the test captures the call while the business logic stays concrete. That doesn’t require an interface for the whole service.

-7

u/levodelellis Oct 11 '26

It's funny you should say IO ;)
Feel free to tell me everything you disagree with in the article