DEV Community

Discussion on: Should you always code against an interface?

Collapse
 
alainvanhout profile image
Alain Van Hout • Edited

My view (similar to yours, it seems): adding an interface means adding complexity. That complexity will have benefits in some cases, but outside those cases all you have is the cost of the abstraction. And as has been said, everything can be solved by adding another layer of abstraction, except having too many layers of abstraction.

So the question becomes: in your case, does it offer an actual, concrete benefit, to offset the cost of added complexity?

Collapse
 
tomaszs2 profile image
Tom Smykowski

Thanks for your insight. Ps. I love the saying about solving things with abstraction :-)