News for hackers. Stuff that matters.
Re:Inheritance was invented as a performance hack by layer8 on Thursday May 08, 2025 @10:55AM (#43926665)
The diamond problem strictly speaking only has to be one when the common base class has constructor arguments. While a Java-style interface construct makes it easy to prevent, it also imposes much stronger restrictions than the above. It would have been possible to only impose the above restriction. Yes, there are failure cases with separate compilation, but the way Java dynamically loads classes, that would be similar to how when the JVM loads a class file that is supposed to be an interface, it discovers that instead it has been changed to a class.

There are no comments on this comment yet.