Java SDK 1.5 'Tiger' Beta Finally Released
kingkola writes "Finally, after about two years of development, the Beta for Java SDK 1.5, aka Tiger, has been released. Features added in this edition include generics support, autoboxing of primitives, syntactic sugar for loops, enumerated types, variable arguments, sharing of memory between multiple VMs and a bunch of other bugfixes, enchancements, etc."
What Java is is a memory hog. "Hello World" can easily consume a megabyte of RAM. The shared memory will help this situation. (Incidentally, the shared memory idea was originally developer by Apple for Mac OS X. Apple worked with Sun, and donated code, to make it universal).
There ain't no rules here; we're trying to accomplish something.
A friend of mine is bitching about this: if you type a list, say ArrayList, you can't use that as an argument for a function that takes a ArrayList. He's tried casting it, it just doesn't like it. Anyone else seen something like this?
Another change that caught my eye was a skinnable theme for JFC called Synth. I wonder if this will help Java capture some of the kewl market for media players etc.
I also see the beta is being made available for 64-bit Linux.
As a platform, Java is still miles ahead of c#. But I sometimes wonder if the message is lost amongst all the specifications and implementations of specifications. The
I played with the alpha and gave a presentatation about it at my employer. Lots of people were enthousiastic.
Plug: java-1.5_new_features_en_v2.ppt
8 of 13 people found this answer helpful. Did you?
Linux, AIX, Windows. We can develop our J2EE apps on any of these platforms and they 'just work' on the other 2 with no extra work. It's glorious. Ever try to cross-compile a non-trivial C/C++ program. Yuck.
Blar.
Actually, 1.5 beta has been available for a few months now, but the link wasn't on the main java.sun.com page.
Here are some highly unscientific benchmarks of startup time I just ran on my Athlon XP 2000+ under Mandrake 9.2:
These are relatively consistent over multiple runs.
>>>generics support
>>C# innovated this, and already has this in the spec
> C++ had this way before. Next...
C++ does not have generics, it has templates, which are quite different. Templates cannot be verified when they are compiled, only when they are instantiated. Generics can be verified when they are compiled, so when they do compile you are guaranteed that they will work for any instantiation. Also, generics (in the MS implementation, at least) do not duplicate code as much as templates: methods that can use the same instructions because the instructions do not depend on the actual type share the same code.
>>>enumerated types
>>Java didn't have this before? LOL
>No, and not always very useful. It's just neat.
I do not think there are may people that share that view; I certainly don't. Defined constant integers take more typing to enter, they cannot be reflected over as a unity (as they aren't), and they are not type safe.
I do agree with you that most items in the grandparent post are no innovations, but they sure are nice to have.
I really like the new language features (and will use them in about 5 years when our server is upgraded :-().
But Swing is even uglier than before. Metal still looks very old, but now it looks like someone very old with obscene amounts of make-up on.
The GTK+ look is even worse. It doesn't look like GTK+ at all (I'm not even sure whether it's supposed to be GTK1 or GTK2).
Worse: font rendering is abysmal. Buttons and menus are barely readable using the GTK+ emulation L&F. The Java VM still doesn't use Xft/Freetype, which pretty much makes the attempt at GTK+ emulation useless.
As much as anyone loves a good berating of a pro-Micrsoft poster, I think both posters missed some relative points.
.NET developer, but I choose the right software for the right job . I'm glad to see Java stepping it up a notch, I just hope that it is not too late.
While the parent mod, loved to cite counter example of technologies utilized previous to C#, I think he missed a good point. C# was the first to pull ALL of these things together under one hood and they did so a few years ago. Don't get me wrong, I'm a java (mainly) and
Sig it.
I don't want to start a flame war, but do you think that the pressure of .Net pushed some of these features through that Sun seemed to be holding off on for the longest time.
.Net made it's comming out in 2002.
Such as enums, generics, boxing, foreach loop, etc.
Just a question that I have had, because I never heard anything about these features comming into Java until after
I know the compile-time checking for things like ArrayList is a good thing, but is there any note on how this may impact things like HttpSession or HttpServletRequest attributes, where different data types are essential?
I'm still stuck on 1.3 due to the Blackdown JVM's Debian package not being updated for 1.4. I could do it non packaged-managed, but I'd really rather not...
It bothers me when Java's portability is extolled. C is portable too, to more platforms than Java is. And the system call libraries on most platforms have C interfaces, not Java. The only interactions with the host OS that Java supports natively are through the weak File and System objects, through which I can only get the most generic information. For everything else I have to use JNI and, you guessed it, C.
Java's only better if you don't know what you're doing (you can't have pointer bugs, for instance). C and C++ are better when you want to build your language constructs from the bottom up at the same time that you write your program from the top down.
Pretty cool stuff, and it shows that Sun does accept changes to Java from the outside that are of clear benefit.
- Vincit qui patitur.
Our open source SwingSet toolkit for making the Swing components database-enabled/aware will now be much easier to install/distribute. Hooray!
Sun have been promising generics for Java since 1997, and I have been patiently waiting for it all this time.
:)
I haven't had the chance to look at C# in detail yet, but it's certainly no co-incidence that these features finally saw renewed activity after C# appeared. So, thanks, MS, for applying a little competitive pressure onto Sun for us
I'm also a little disappointed to see just how similar Java generics are to C++'s templates. I was hoping that we were waiting for a *reason*, and that reason might be because it was a new and interesting approach. But, at least superficially, this looks almost exactly like C++ templates, with all the positives and negatives that go along with that.
Here's a screenshot of my EBLA project using the new default look & feel and the new SwingSet navigation bar.
Python is not weakly typed. It is dynamically typed. But you knew this, and just made an honest mistake because you do real work. ;)
... but you can't, because it raises a (gasp) type error! Just as a comparison, consider C -
/* perfectly valid */
;)
If python was 'weakly typed', you could do this -
foo = 5
bar = "duh"
foo = foo + bar
int foo = 5;
char* bar = "duh";
foo = foo + bar;
(before I get flamed, yes, I _know_ this is nonsense, so was the python example - the point is python complains, C doesnt. Btw, the C example is not valid C++ code (C++ has stronger typing semantics))
I personally find static typing to be relatively useless. It basically is only useful for optimization purposes. By knowing the type at compile-time, certain optimizations can be made. But, we all know that "premature optimization is the root of all evil"
The best compromise is to allow both typing schemes - dynamic, unless specifically statically typed. That way, if I determine a bottleneck is due to dynamic typing, I can use static typing. Now that is something I would like to see in Java.
"I think he missed a good point. C# was the first to pull ALL of these things together under one hood and they did so a few years ago."
I think you in turn missed his point. The post he was replying to claimed that C# had innovated these features. He was demonstrating that those features had in fact existed in other languages previously.
And many serious problems remain with the Java language:
The most serious problem with the Java platform is and remains, however, that it is basically proprietary: all Java 2 platform implementations depend crucially on code licensed from Sun (e.g., there is no independent Swing implementation). Furthermore, there doesn't exist a Java standard that people can implement without having legal constraints imposed on them by Sun.
No...Please re-read my post. I never claimed C# innovated anything...I said they were the first to put them all under one roof.
Sig it.
All the java products you mention are free. How much does VS.NET and IIS cost?? I do agree that for 'visual stuff' (ie. guis) ms development tools are still ahead.. but with the rate of innovation in the java world.. they won't be for long.
If you need anything moderatly complex like say, push database updates to a smart cache in your webserver, doing it in .NET will require writing lots of custom code. Whereas using Resin, it's already built in and is easy to use. People should get over the whole technology thing and do what makes the most sense. I develop with .NET as my primary job and I have to say, we've practically rewritten and over-rided the default webservices mechanisms. This isn't because we like to re-invent the wheel. It's because we're building apps that are moderately complex and the basic stuff doesn't cut it. If I had to build the same thing with a servlet container, I can honestly say, it would have been done 5 months ago. We still have many months left in our dev cycle to replace more stock stuff, so that we can get the functionality we need.
will be code like this:
s ()) { ...
Enumeration enum = collection.elements();
while(enum.hasMoreElement
}
Guess what... that is a compile error now. "enum" is a new keyword, and is no longer valid as a variable name.
Scott
Obviously, you work alone, or your co-workers that have to maintain your code hate you.
Code is not just instructions for a computer, it is a form of communication between developers that tells of the problem domain you are solving.
The code below does the same thing. The first is faster to write. Which would you rather have to maintain?
X = X - XX;
XXX = Aretha + SalesTax(Aretha);
X = X + LateFee(X1,X) + XXX;
X = X + Interest(X1,X);
or
balance = balance - lastPayment;
monthlyTotal = newPurchases + SalesTax(newPurchases);
balance = balance + LateFee(customerId, balance) + monthlyTotal;
balance = balance + Interest(customerId, balance);
(Hey,was I just trolled?)
I did, and there are other add-ons too (I remember some Sourceforge project). But I don't like that it isn't part of the core SWT library. Why didn't they support MVC from the beginning? I guess SWT is supposed to be relatively low-level. But that's not what everybody should use, in my opinion, to get back to the original argument.
The "enhanced" loop removes readability from the language, but just that.
Autoboxing is more problematic. For example, if you declare
you might be thinking the intList is backed by an array of ints (int[]), but they are not. They are backed by an Object[] and every element is an Integer.
AFAIK, There is no way to create an ArrayList backed by an int[], so you have to create an alternative class or use int[] directly, but naive programmers are surely going to believe that an ArrayList will be as efficient as an int[] when it will clearly not be.
My heart is pure, but make no mistake, it's pure evil