News for hackers. Stuff that matters.
Re:Generating a Java program with 90% less code by Quekid5 on Wednesday December 04, 2019 @12:00PM (#21703966)
You can do that with classes -- as long the dependents don't instantiate their dependencies directly.

However, I personally like interfaces (well, traits, I'm doing scala), because it makes it much easier for readers to understand what bits are supposed to be part of the interface and which parts are supposed to be an internal implementation detail. Without interfaces it's really easy to accidentally change e.g. a return type into a more concrete one which accidentally leaks impl. details and suddenly other bits of code will come to rely on those impl. details. I work on rather large/complicated systems and I've seen this gradual spaghettification time and time again.

Disclosure: I'm usually the person who gets called in to fix the mess -- so that might bias my perceptions here.

There are no comments on this comment yet.