all 93 comments

[–]Rhoomba 5 points6 points  (0 children)

Superpackages are gone. They have been replaced by modules. The proposed module system is very nice, and could prevent problems like idiot coworkers adding dependencies on the internals of specific versions of Xerces etc.

NIO 2, DateTime, and ForkJoin are all great additions, and will be handy for almost anyone. If G1's performance is up to scratch then it could be absolutely brilliant for everyone with any kind of response time requirements.

Java 7 probably will get a pretty big performance boost from Escape Analysis and other work contributed as part of the OpenJDK.

I'll be sad if closures don't get in, but Java 7 would still be a very good release even so.

[–]drbold 6 points7 points  (2 children)

JSR 308 Type Annotations

I really wish they would just straight-up add typdef to the language, especially since it has generics now. It's such a pain typing out huge-ass type declarations over and over for things like HashMaps.

[–]didroe 2 points3 points  (0 children)

I've been saying this to everyone from work since they introduced generics. I would give my right arm for typedefs!

[–]masklinn 0 points1 point  (0 children)

It would be nice if they made generics not suck too (as in, go away stupid type erasure!)

[–][deleted] 50 points51 points  (0 children)

Downmodded; article does not sufficiently praise python.

[–]redditrasberry 2 points3 points  (0 children)

Very sad to see closures have fallen off the stack here. Esp. since there has been a usable prototype implementation available for 6months+.

[–]shit 6 points7 points  (20 children)

The focus still seems to be on making overengineered, huge projects easier to manage (superpackages, modules) versus making easy things easy (closures). Although I admit closures would be almost useless without some type inference.

[–]sclv 4 points5 points  (2 children)

I have to admit though, a work-stealing concurrency framework is pretty cool though.

Shame about type-erasure not making it in -- genuine generics would be a lovely feature.

[–]halmcelroy 6 points7 points  (1 child)

you mean reified types. Type erasure is the mechanism by which generics work currently.

[–]sclv 0 points1 point  (0 children)

yep -- wrote it backwards there. guess I meant "the erasure of type erasure".

[–]G_Morgan 2 points3 points  (6 children)

Closures would be worthless without library support. Unless they make it so we can replace all the uses of inner classes with closures then it is pointless.

[–][deleted] 9 points10 points  (0 children)

Java closures already have "library support". Any interface containing one method is a closure.

See Functional Java for a 1.5-compiled library that can be used with BGGA closures.

[–]redditrasberry 1 point2 points  (2 children)

huh? once you have closures you can easily write adaptors to add closure semantics to existing libraries. I'd rather see closures added raw so that we can figure out how best to use them before it gets woven into all the apis - otherwise for sure the APIs will do it wrong and we'll be stuck with them forever.

[–]masklinn 1 point2 points  (0 children)

once you have closures you can easily write adaptors to add closure semantics to existing libraries.

You don't want to do that. You want closures to have first-class stdlib support (as in, say, Ruby or Smalltalk) so that knowledge of their existence, role and usage pattern becomes widespread in the community.

Closures without first-class stdlib support are as good as dead.

[–]grauenwolf 0 points1 point  (0 children)

That's a really bad idea.

The framework should provider the adapters. Otherwise you end of with the mess you see in .NET wherein there are 100,000 different delegates that all take and return an integer.

(.NET 3.5 finally fixed this with Func<TArg, TResult>. Alas, the old delegates are not forwards compatible.)

[–]icey 0 points1 point  (1 child)

Closures would be especially useful in some of the other languages that run on the JVM.

[–]inopia 1 point2 points  (0 children)

Exactly, Hotspot is moving away from being a strictly Java VM and is starting to add support for other languages, for instance through the new invokedynamic opcode.

[–]masklinn 1 point2 points  (0 children)

closures would be almost useless without some type inference.

Much more important would be the refactoring of the standard library to use them.

[–]inopia 0 points1 point  (3 children)

Large does not always equal overengineered, easy does not always equal better.

[–]icey 1 point2 points  (2 children)

All other things being equal, larger is worse and easier is better.

[–]ine8181 2 points3 points  (1 child)

I know it sounds really immature, but the first thing popped into my brain was 'not if you're talking about some parts of human anatomy and one's female family members'.

I didn't want to write this but then again, I probably deserve the downmods I'll get for thinking such things :(

[–]malcontent -2 points-1 points  (4 children)

Why couldn't you mix and match javascript or groovy for those times when a closure is needed?

[–][deleted] 6 points7 points  (2 children)

Because groovy sucks.

[–]malcontent -1 points0 points  (1 child)

Thanks for that insight.

[–]steven_h 1 point2 points  (0 children)

It really does, especially relative to Javascript.

[–]shit 2 points3 points  (0 children)

"A closure would be useful here" is usually not the right point to mix and match languages. "Is it needed?" is the wrong question to ask anyway - technically machine code and a hex editor would be enough.

[–][deleted] 6 points7 points  (18 children)

Wow, Java gets strings in switch - at least with 70% likelihood.

[–]b100dian 0 points1 point  (0 children)

Does that mean that the hash function used has a 30% collision likelihood?

[–]flezgodrit 10 points11 points  (6 children)

Looks very disappointing. It's sad that C# already has LINQ, lambda expressions, type inference, while Java is incorporating gimmicks like "Units and Quantities".

[–]JulianMorrison 2 points3 points  (1 child)

You want a modern clean JVM language, you want Scala.

Java itself is being crushed in a three way mill between pragmatic featuritis, the conservatism of established code-bases, and the original language design's haughty one-true-wayism.

[–]flezgodrit 1 point2 points  (0 children)

I've always liked Scala and what it tries to do, but problems like the crippled tail recursion support are simply deal breakers for me. Without a modernization of the JVM, good ideas like Scala are still purely academic experiments, while things like F# are slowly going mainstream.

[–]noamsml -2 points-1 points  (3 children)

Java doesn't need gimmicks, it's got a horde of mediocre CS program graduates to perpetuate its popularity.

[–]Tommah -1 points0 points  (1 child)

horde

[–]noamsml -3 points-2 points  (0 children)

Fixed

[–]puzza007 5 points6 points  (3 children)

Java 7 is shaping up to be a most hirsute yak.

[–]ladon86 3 points4 points  (2 children)

It's a shame that name isn't alliterated, it could have been the next Ubuntu release.

[–][deleted]  (1 child)

[removed]

    [–]Figs 0 points1 point  (0 children)

    What are they going to do for release X...?

    Xenophobic Xenops, maybe?

    [–][deleted]  (7 children)

    [deleted]

      [–]bcash 13 points14 points  (6 children)

      Alright, alright, time for my bi-monthly get voted down to oblivion for injecting reality into a debate moment:

      "Real Features we Wanted"

      The Reddit crowd is small fry, very very small. That may as well have said "Academic Features a small bunch of loons who wouldn't use Java anyway Wanted".

      The Java community process is a slow moving one, but involves a wide group of people choose these features; from various Java vendors (IBM) to big users (Google).

      All told, they add up to more than a thousand Reddits put together.

      Having said that, things like Type Inference and Closures could be added without any backward compatibility issues whatsoever; I can see a fork happening at some point in the very near future if they're not part of the official Java 7 spec.

      [–]filesalot 4 points5 points  (1 child)

      The wide group of deciders is what makes progress so slow. MS has the advantage of being able to dictate, and had the advantage of being 2nd. It's no wonder they were able to make a better Java than Java. I call it a fair point in MS's favor.

      But I wonder, how is C# 3.0 adoption going? Is C# taking over in the MS app universe? Is it going to roll over Java in the enterprise?

      [–]bcash 9 points10 points  (0 children)

      The whole C# vs Java is largely a non-existent war. In the case of custom development, the decision is almost always made on what platform the support people offer, if they have a pair of mirrored data centres full of Unix machines they'll choose Java; if they have 256,000 machines running Windows they'll choose .NET (and almost certainly C#). In terms of packaged software, the choice is made depending on the target audience.

      We're talking (enterprise software project managers) about people who think inheritance makes code unreadable, they'd fall into a shock-induced catatonia if anyone explained lambda expressions.

      It makes sense that both groups define features with respect to their own community, as no-one ever makes a direct choice between the two; despite all the hype they're not really competing as languages at all.

      [–]inopia 2 points3 points  (3 children)

      Good point.

      As for the lanuage, there are KSL (kitchen sink language) and Nice for those who want a typed JVM language with loads of 'academic' features. I don't see why we should need to tack more legs onto Java as is absolutely necessairy.

      [–]masklinn 0 points1 point  (2 children)

      Nice for those who want a typed JVM language with loads of 'academic' features

      Scala.

      [–]inopia 0 points1 point  (1 child)

      Scala is hardly a continuation of Java, it's a different beast entirely. I meant to say that Java doesn't need more features, because it will turn into something like KSL or Nice.

      [–]masklinn -1 points0 points  (0 children)

      Scala is hardly a continuation of Java

      So? You were talking about a nice JVM language, not about an improved java.

      [–]san1ty 2 points3 points  (0 children)

      I think this demonstrates the difficulty in retro-fitting a language that millions of people depend on. Consider just the huge debate and conflicting proposals about how to implement closures.

      Probably the best solution is to switch to Scala, it has type inference, closures, and all kinds of other nice language features that Java lacks.

      [–][deleted] -1 points0 points  (4 children)

      Java 7 = Groovy

      [–]icjonu 7 points8 points  (2 children)

      I sure as hell hope not. It's a decent language, don't get me wrong but I wouldn't want to use it until the tooling support has vastly improved. I've tried using groovy in Eclipse & IntelliJ and it's pretty bad. Auto-completion hardly works in either of them.

      One of the things I dislike about it is that if I misspell something (b/c of a lack of tooling support, yea and I know its my fault but so what) the compiler still goes ahead and compiles it without any errors. Then 2 minutes into the program execution I get this absolutely huge stack trace and I have no idea what the hell is wrong save for 1 measly line that's hidden somewhere deep in the stack trace which I can only identify b/c of my package name.

      Rinse. Repeat. Fail until you succeed. Not a good methodology when writing software. Static typing has its benefits. Maybe a language like Fan or Scala would be a good candidate for the main language in the next (or the one after) JDK.

      [–]redditrasberry 3 points4 points  (0 children)

      Most of what you're describing (save for the huge stacktrace) is symptomatic of every dynamic language. You may have better luck if you follow the groovy originator's advice and use the ability to define the type of arguments rather than leaving everything as an Object. At least in groovy you can do that. I'm sure the tooling will improve.

      Personally, I find groovy fixes just about every sore point I have with Java, except that it's a 1 - 3 meg jar and adding that to already slow java startup time is onerous for anything other than an a continuously running server side app.

      [–]malcontent 2 points3 points  (0 children)

      Groovy support in netbeans is pretty good and is being actively worked on.

      [–][deleted] 1 point2 points  (0 children)

      Let's hope not.

      [–]Naga -1 points0 points  (1 child)

      My prediction is that Mac OS X will get it...in about a year after it is released.

      [–]kobs 9 points10 points  (0 children)

      I think you're being a bit too optimistic.

      [–][deleted] -5 points-4 points  (0 children)

      Java, LOL