What is a "modern" programming language?

What modern programming language features will be difficult to add to future versions of Java?

  • Oracle is trying to make up for lost time coming up with new versions of Java.  I assume they will never want to add a compatibility-breaking feature to the language (I'd like to hear if you disagree). If my assumption is correct are there any features that will be difficult for them to add?  Are there any features that you don't think they will be able to add? Some difficult to add features that come to mind are: variables that can't be null, refied generics (in other words generics that don't do type erasure at run-time), really well supported generics.

  • Answer:

    As you mentioned, null references would be hard to get rid of. We could introduce a NotNull<T> container, perhaps with some syntactic sugar, but nullable references will probably always be the default. Now that interfaces can have default implementations, the distinction between between classes and interfaces is rather subtle and not well justified. Unifying them into a single construct would improve the language IMO, but this would be very difficult to change smoothly. Scala's generic are considerably more useful thanks to variance, but Java will probably never support generic variance. Wildcards are "good enough", transitioning abruptly would break tons of code, and supporting variance and wildcards at the same time would be awkward. Primitives ought to be a compiler optimization rather than a programmer concern, but now that they're widely used, phasing them out would be costly. Java's collections framework lacks immutable interfaces, and they would be difficult to introduce into the existing hierarchy. Since Collection is a mutable collection, what would you call a base collection type which may or may not be mutable? We could transition to a completely new collection hierarchy like https://github.com/dlubarov/daniel/tree/master/data/src/main/java/com/lubarov/daniel/data, but that would be very costly.

Daniel Lubarov at Quora Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.