Re: Java 7 features



On Jul 2, 6:20 pm, Tom Hawtin <use...@xxxxxxxxxxxxxxxxx> wrote:
Joshua Cranmer wrote:

@ Closures

But we already have (minimal) closures. I think it would be much more
sensible to improve what we already have, rather than to duplicate. It's
probably unlikely to get in before Java 1.8 anyway.

We already have Runnable. Who needs something else? Although it would
be nice if it were a la Smalltalk:

new Thread( new Runnable() { public void run() { doSomething(); } } );

Would become:

new Thread( <quote> doSomething(); );

Where <quote> could be:
1. [] a la Smalltalk, ie: [ doSomething(); ] It would look ugly in
Java, though.
2. ' (quote) a la Lisp, ie: 'doSomething(); It looks horrible in Java,
so forget about it.
3. # a la Smalltalk, ie: #doSomething(); Not bad, eh?

@ Strings in switch statements

Not too fussed. It'll make switches on strings clearer, but perhaps will
encourage poor code.

Simply use hashCode(), ie:

switch( str.hashCode() )
{
case "hello".hashCode(): ...; break;
case "bye".hashCode(): ...; break;
}

@ Operator overloading for BigDecimal

BigDecimal and BigInteger are hideous to use at the moment. The overflow
semantics of primitive integers are not something that I think should be
in a high level language. I'd prefer general operator overloading of
sensible operators.

It would be nice if all numerical classes in Java were retrofitted to
descend from Number (or implement Number), so that you could declare a
number and it could contain any number: float, int, bigdecimal, etc.

@ Language-level XML support

Evil and unnecessary. A lot like much of XML.

Use XStream instead.

@ Reified generics

This could have made sense in 1.5. But I don't think this is really on
given the situation we have got ourselves into.

What do you mean?

@ Superpackages

Good. I guess packages provide what is necessary from superpackages, but
we tend to write libraries and applications in more than one package.

What is a superpackage?
Is it this? http://blogs.sun.com/gbracha/entry/developing_modules_for_development

I hope not.

First, EJB already have modularization, you deliver 2 jars, one for
use on the client and another for the whole implementation. It is
trivial (some could argue), but it already works.

The same approach could be used for super packages, have some "client"
package and stuff subpackages inside, and another "implementation"
package and stuff everything else, so that all interfaces and Transfer
Objects go into the "client" packages, and the rest have all the
implementations of those interfaces, great!

EJB was a dead horse because the Enterprise Java Beans did not need to
implement the remote interfaces, and besides the home interfaces were
unnecessary. If they had only one interface and one class (it could
have many implementations, but follow the idea for a minute), it would
be nice.

@ Removing checked exceptions

I like static type checking.

Sometimes it gets in the way, but you can always convert those to
RuntimeException, what is the big deal?

Why does people need to force other into their preferences?

Tom Hawtin


.



Relevant Pages

  • Re: What multi-tier components to use
    ... Enterprise Java Beans. ... > with every change in the parameter list, you could make your new server ... But surely if you have an old client and the interfaces are still valid on ...
    (borland.public.delphi.thirdpartytools.general)
  • RE: Remoting and serialization
    ... if you use MarshalByRefObject for all of your "shared" objects (not ... use of interfaces and serialization. ... The decision to use Java versus .NET isn't so much about technology as it is ... you need the ENTIRE class graph for that object on your client. ...
    (microsoft.public.dotnet.languages.csharp)
  • A whole host of software problems :-)
    ... I've had some problems with CSW packages since I tried to ... first of all cleaned out all of my CSW installations, ... older versions of GIMP and Mozilla from unofficial mirror sites. ... insisted on updating Java, and I think that was when the problems ...
    (comp.unix.solaris)
  • Re: Module clarification
    ... I'm a Java guy and I'm playing around Python these days... ... we organize our classes into packages and then jarring the ... because the namespace is tied to ...
    (comp.lang.python)
  • Re: Store part of GUI at the server side.
    ... > where I have to modify the client application after the deployment. ... > I have developed my client application using server side programming approch ... But for the GUI part I'm still using the traditional ... RTL and VCL run-time packages for this, and you will typically also have to ...
    (borland.public.delphi.language.objectpascal)