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
Related Q & A:
- What are the common usage of python programming language?Best solution by quora.com
- Which is the best programming language?Best solution by Yahoo! Answers
- What programming language would be appropriate for better job opportunities?Best solution by quora.com
- Is java or visual basic a machine level, low level, high level or binary level programming language?Best solution by Quora
- Who of the royals will have a child in near future?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.