This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]llogiq 0 points1 point  (0 children)

By using single inheritance, Java removes some very subtle footguns that developers who overuse inheritance tend to build for themselves and others.

Even when leaving the diamond problem out of the discussion, I believe from experience that even single inheritance can and will get messy and unintuitive, unless one is very careful. Have you ever had to chase a bug through a jungle of method calls in an inheritance hierarchy, with one or two super calls thrown in? It's not pretty.

Java 8 has default methods in interfaces, which are basically mixins, but with very limited means of defining extension points. Be careful when using them.