3 ms·
Prefer composition over inheritance has been a common mantra for at least a decade, if not more. Maybe you should undergo the last decade of development and tra
by kaba0 3y ago
Prefer composition over inheritance has been a common mantra for at least a decade, if not more. Maybe you should undergo the last decade of development and training.
There will always be shitty devs, and since java is one of the biggest languages, it definitely has more than some ultra niche academic language no one uses. I don't think it is the fault of the language though, or if that somehow were a reason to choose a different language. Should a decent BMW driver sell their car, because plenty assholes buy that car also?
- insanitybit 3y agoJust because everyone has been saying "composition over inheritance" doesn't mean that that's how things get done. Jump into any Java codebase and you're 99% likely to see inheritance used as one of the primary abstraction mechanisms. > Should a decent BMW driver sell their car, because plenty assholes buy that car also? A better analogy would be "Should you drive on the street where all of the shitty drivers do donuts and street races?"
- mrkeen 3y ago> Prefer composition over inheritance has been a common mantra for at least a decade, if not more. Maybe you should undergo the last decade of development and training. What are some other well known mantras? The null reference is a billion dollar mistake? Minimise mutability? Maybe the language designers and library writers could catch up too.
- kaba0 3y agoInheritance is a useful feature, using bad abstractions is a user error. Nulls are an error in that no language feature solves them (though third-party tooling does), so far at least.
- za3faran 3y agoRecords and value/primitive classes are immutable, not to mention https://openjdk.org/jeps/401 https://openjdk.org/jeps/401