JSR 666: Solving Java's Problems
You may be interested in some new developments in JSR-666 (the JSR from hell). This is an excellent JSR containing many important enhancements for Java. Maybe we can even get it into Java 7.
This JSR contains the following list of recommendations:
- Import on Demand, With Extreme Prejudice. You can get rid of all those pesky imports and instead them with a simple: "import *;".
- Default throws Clause. Treat an omitted throws clause as if "throws Exception" was declared.
- Eliminate NullPointerExceptions. Remove null and require that all variables have a valid value.
- Extended Operator Set. Why waste all those Unicode characters? For example, ∞ should be BigInteger.MAX_INT. Some updates can be found on the post-assignment operator as well.
- The 'that' keyword. For referencing objects that don't exist yet, did exist but were GC'ed, etc.
- SchrödingerException. An exception for dealing with the case where both IllegalArgumentException and NullPointerException seem like good choices. This exception can exist as either till a point where the exception is caught, at which time it collapses to one or the other.
Many props to the JSR 666 expert group: Alan Green, Charles Miller, Mike Cannon-Brookes, and AJ Fitzpatrick.
Alex Miller lives in St. Louis. He writes code for a living and currently work for Terracotta Tech on the Terracotta open-source Java clustering product. Prior to Terracotta he worked at BEA Systems and was Chief Architect at MetaMatrix. His main language for the last decade has been Java, although Alex have been paid to program in several languages over the years (C++, Python, Pascal, etc). Alex is a DZone MVB and is not an employee of DZone and has posted 43 posts at DZone. You can read more from them at their website.
- Login or register to post comments
- 7564 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
cowwoc replied on Wed, 2008/02/13 - 5:22pm
I was about to post a comment telling you off before I clued in ;)
All I've got to say is that it's a good thing that Java doesn't allow identifiers to be declared using Unicode characters. I'll spare you the headache of debugging code with Russian or Japanese comments. I'd hate for the actual code to use these characters :)
Bruno Laturner replied on Wed, 2008/02/13 - 10:25pm
in response to: cowwoc
Actually...
Loren Kratzke replied on Thu, 2008/02/14 - 12:46am
Rick Ross replied on Thu, 2008/02/14 - 8:02am
David Sills replied on Sat, 2008/02/16 - 2:49pm
Alexander Beloturkin replied on Sat, 2008/02/16 - 4:27pm
>> Eliminate NullPointerExceptions. Remove null and require that all variables have a valid value.
I don't think that this is a good idea. Null is very important.
Artur Biesiadowski replied on Sat, 2008/02/16 - 8:21pm
in response to: amigooo
Naaah.
For strings iuse "" instead of null. For primite wrappers, null is just messing around with autoboxing - and double has NaN which can be very well used to represent tricky values. When you have Person class, instead of using null to indicate that Cat has no owner, you can have special marker instances like GENERIC_GRAVEYARD_OLD_LADY to indicate it is fed by unknown person, or FURRY_GRIM_REAPER to indicate it is soon going to die from not being fed.
Obviously removing null won't happen anytime soon, because Java 7 is sponsored by letter N.
Alexander Beloturkin replied on Sun, 2008/02/17 - 4:15am
in response to: abies
"" and null is not the same. This is completly different things. About the null marker, you right, this is one the possible solution, but if for every null in program we start to use some kind of markers, it can make our code unmaintainable. And in reality we will have many problems instead of NPE.
Any way I agree with you that this is not happen in nearest future.
Artur Biesiadowski replied on Sun, 2008/02/17 - 6:21am
in response to: amigooo
I thought that I'm obvious enough, but it seems not.
Alexander, this entire thread is a satire. None of the posts above, including mine, are serious. There are some subtle hints indicating it, including "Geeze, I thought this was serious for a minute" from Loren, but it is probably time to state it yet more clearly.
Alexander Beloturkin replied on Sun, 2008/02/17 - 7:14am
in response to: abies
Yes, I understand this from first post.
shinger replied on Tue, 2009/04/28 - 3:27am
iilei replied on Wed, 2009/05/20 - 2:02am
inak replied on Fri, 2009/05/22 - 9:35am
kinds33 replied on Fri, 2009/06/05 - 1:11am
imds replied on Fri, 2009/06/05 - 9:24am
This is what we are working out for.I really needed this info.This helps me a lot in my designing.Thanks for sharing.
imds replied on Fri, 2009/06/05 - 9:26am
imds replied on Fri, 2009/06/05 - 9:28am
mimd replied on Wed, 2009/06/10 - 1:21am
mijo77 replied on Fri, 2009/06/12 - 3:11am
mijo77 replied on Fri, 2009/06/12 - 3:14am
scater replied on Thu, 2009/06/18 - 6:29am
scater replied on Thu, 2009/06/18 - 8:58am
yhuji replied on Sat, 2009/06/20 - 4:43am
vanuji replied on Fri, 2009/07/10 - 12:16am