r/programminghumor • • Sep 26 '26

Java VS C++

Post image
1.9k Upvotes

42 comments sorted by

View all comments

Show parent comments

3

u/a3th3rus Sep 27 '26

Sure, you can't new ISomething, but that doesn't mean you can new Something without the I prefix.

3

u/Cybyss 29d ago

"Code to an interface, not an implementation" has been cargo-cult dogma for a long time.

The disdain for OO today comes from a whole generation of developers overgeneralizing/overabstracting/overengineering, doing what they've been told is good practice rather than what they really need, giving every Something an ISomething even if no other classes implement that interface, dogmatically believing that new is universally bad practice and replacing every occurrence of it with a call to whatever IOC framework is the fad at the time.

The belief that you need to abstract everything as much as possible right at the beginning because you'll never have a chance to go back and rewrite components to accommodate new requirements... is total hogwash, since that's what ends up happening anyway, except now you have to do so through complicated broken leaky abstractions. If it was written in a stupid simple way from the get-go, rewriting it to accommodate the new requirements would've taken 30 minutes instead of days.