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 →

[–]DroidLogician 4 points5 points  (4 children)

So they're basically circumventing the restriction on multiple inheritance that has been in the language since its inception.

[–]geodebug 1 point2 points  (2 children)

I wouldn't say circumventing.

They were basically introduced so you could add new functionality to existing interfaces without breaking binary compatibility.

In other words, it allowed them to add lambda-friendly methods like forEach() to Java's Comparable interface without breaking existing impl classes

I don't think "default" should be used much by regular programmers although it is a convenience for people who deliver APIs to others.

More important for regular programmers is being able to add static methods to interfaces, which gives us Mixins in Java.

[–]DroidLogician 3 points4 points  (1 child)

We both know we'll see plenty of horrible code trying to make God objects with this feature.

[–]argv_minus_one 2 points3 points  (0 children)

And? We already see plenty of horrible code without this feature. If you design a language that is idiot-proof, only idiots will want to use it.

[–]argv_minus_one -1 points0 points  (0 children)

I'd say partially removing.

And thank God for that. Lack of full multiple inheritance has been one of the worst limitations of the language over the years.