Skip to main content
Mod Moved Comments To Chat
added 242 characters in body
Source Link

I wonder if there are reasons not to use it.

How about, um, compatibility with older JVMs?

Do you consider this a good idea in general?

No. It is a backwards-incompatible change that adds zilch to the expressivity of the language. Two thumbs down.

Are there some model situations where you strongly recommend classes?

I strongly recommend using classes to contain implementation details. An interface is really just meant to say "this Object supports operations XYZ" and that has nothing to do with any static methods you may think of putting in the interface declaration. This feature is like a recliner with a built-in mini-fridge. Sure it has some niche uses but it doesn't pull enough weight to deserve being mainstream.

UPDATE: Please no more downvotes. Clearly some people think static methods in interfaces are the bee's knees, and I'm hereby capitulating. I'd just as soon delete this answer but the comments attached to it are an interesting discussion.

I wonder if there are reasons not to use it.

How about, um, compatibility with older JVMs?

Do you consider this a good idea in general?

No. It is a backwards-incompatible change that adds zilch to the expressivity of the language. Two thumbs down.

Are there some model situations where you strongly recommend classes?

I strongly recommend using classes to contain implementation details. An interface is really just meant to say "this Object supports operations XYZ" and that has nothing to do with any static methods you may think of putting in the interface declaration. This feature is like a recliner with a built-in mini-fridge. Sure it has some niche uses but it doesn't pull enough weight to deserve being mainstream.

I wonder if there are reasons not to use it.

How about, um, compatibility with older JVMs?

Do you consider this a good idea in general?

No. It is a backwards-incompatible change that adds zilch to the expressivity of the language. Two thumbs down.

Are there some model situations where you strongly recommend classes?

I strongly recommend using classes to contain implementation details. An interface is really just meant to say "this Object supports operations XYZ" and that has nothing to do with any static methods you may think of putting in the interface declaration. This feature is like a recliner with a built-in mini-fridge. Sure it has some niche uses but it doesn't pull enough weight to deserve being mainstream.

UPDATE: Please no more downvotes. Clearly some people think static methods in interfaces are the bee's knees, and I'm hereby capitulating. I'd just as soon delete this answer but the comments attached to it are an interesting discussion.

Source Link

I wonder if there are reasons not to use it.

How about, um, compatibility with older JVMs?

Do you consider this a good idea in general?

No. It is a backwards-incompatible change that adds zilch to the expressivity of the language. Two thumbs down.

Are there some model situations where you strongly recommend classes?

I strongly recommend using classes to contain implementation details. An interface is really just meant to say "this Object supports operations XYZ" and that has nothing to do with any static methods you may think of putting in the interface declaration. This feature is like a recliner with a built-in mini-fridge. Sure it has some niche uses but it doesn't pull enough weight to deserve being mainstream.