javax: Suggestion for Including New Language Features
Join the DZone community and get the full member experience.Join For Free
For a while now, a lot of people have expressed a lot of opinions about how to keep the Java language up to date with other languages like C#, Groovy, Ruby etc etc. Some want features that they belive would make their life a lot simpler. Others see the same features as a problem that would make their life more complicated. The problem is simple, one solution can't never make everyone happy. Some people hate to type and therefore would like the shortest syntax possible, while other would focus on other problems that in their eyes dwarfs the gains with a short syntax.
The only solution that I can find for this problem is not to make everyone using the same solution but to allow programmers to choose if they would like the Java-language to work. In java (the libraries) we already have a solution for this. Packages that starts with Java are standard, while other packages that could be considerd more experimental are are named javax. I would therefore suggest a simular solution for the Java language. Files named .java are using the same old (slowly evolving) java as usual while those who like to live on the edge using files named .javax. .javax files could have a kind of import-statement for language-features that would tell the compiler what to expect in the file.
There are ofcourse several problems that must be solved. The most important is of political nature. Why should any company allow their programmers to use these new language-features? One solution could be that Sun packages some of these .javax features with the JDK as extensions that they would recomend of think could be close to inclusion to the standard java language.
The main point of the suggestion is to find a way to allow Java to evolve quickly without getting a bloated language.
Opinions expressed by DZone contributors are their own.