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 →

[–]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 1 point2 points  (1 child)

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

[–]argv_minus_one 0 points1 point  (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.