News for hackers. Stuff that matters.
Re:Building an interface (even if there's only one implement... by TimTheTinker on Wednesday May 25, 2022 @11:35PM (#31514169)
Using interfaces everywhere might increase future flexibility, but it comes across as (a) not accepting the idiomatic way of programming in Java, C++, Rust, or C#; and (b) a form of premature optimization (which according to Knuth is the root of all evil, as we all know) -- a lot like premature abstraction.

Duck typing is great, but interfaces everywhere isn't necessarily the answer in non-duck OO languages.

Re:Building an interface (even if there's only one implement... by hderms on Wednesday May 25, 2022 @11:45PM (#31514231)
You could falsely negate a bunch of things by claiming it's premature optimization if you expand it's definition to mean thinking in advance.

That being said I agree with you that interfaces for literally everything is a bad idea. Especially depending on interfaces everywhere, given that it's often quite nice to know concretely what some piece of code is trying to do.

The original post isnt super clear to me regarding how often the author actually recommends using interfaces. The examples used are for storage backends in projects like Kubernetes, which most people would probably agree is a pretty good context in which to utilize interfaces.