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."
Yay, finally some proper java support for IPv6 in windows. Im not an IPv6 zeaolot or anything but its great to be able to write (careful) java.net code using generic InetAddresses and be pretty sure that it will work regardless of which version of IP your network is using.
It bothers me when I read statements like this. Maybe Java is slower than C -- it really depends on what you are doing with each language. For example, heavy duty graphics are not going to fly in Java. However, the portability that a language like Java has, the ease that it can be implemented and the support that it is gaining/has gained in the corporate world makes it a solid competitor.
Every language out there has its own advantages and weakensses. C is fast. It is powerful. The gaming industry will probably always continue to use it unless something exceedingly better comes along.
Java is stable. It is secure. It is very easy to code. Web developers and businesses looking to get multiple systems working together quickly and efficiently will continue to use that.
I don't pretend to be an expert, but from what I've seen, Java is definitely a good thing to have around.
That said, you do give C# much too much credit for "innovation." Microsoft may have a monopoly on a lot of things, but innovation ain't one of them.
There ain't no rules here; we're trying to accomplish something.
So, finally Java is finally catching up to C#.
Eh, considering C# is pretty much a clone of Java, I wouldn't crow to loudly about being first.
As for your specific points here, I think they illustrate that it is good that Java and C# are competing, both are striving to better themselves.
As for the trollish tone of your post, why take this so seriously? You are not your programming language.
Being bitter is drinking poison and hoping someone else will die
Bollocks to that. C# copied generics from C++ (which likely copied it from somewhere else) and so did Java. And they both (C# and Java) got it wrong and missed the point.
Java didn't have this before? LOL
Lack of enumerated types in Java has been a real pain in the ass as was lack of typedef.
Memory sharing between VMs is not so easy to do when you have umpteen platforms to support. Much easier when you have one like in .net.
What .net lacks however is more substantial. There is no API in .net for doing O/R mapping such as JDO or CMP (belch). There is no API for distributed clustered components like EJB session beans. MSMQ is only usable in the Microsoft world. JMS queues can generally be used to integrate with legacy systems. Java has a bunch of great open source tools for it like Eclipse and all its plugins not to mention the Jakarta project. .net has bugger all for a developers' community, unless you consider Microsoft's astroturfing a vibrant community.
Finally .net lacks real credibility in the enterprise. The company that I work for (biggest consulting shop in North America) has a strategy of using .net for quick several week hack jobs but the real projects are always done with J2EE.
Your pizza just the way you ought to have it.
The type checking is much weaker thus introducing new potential holes for error to slip through.
In collections, generics make type checking much stronger. They allow you to find casting problems at compile time instead of run time by not boxing things to Object and back. This also gives a huge speed increase (about 300% in my tests).
When I first learnt Java, I was so excited about the write once read anywhere functionality but many language features (or the lack thereof?) simply bugged me. Then I discovered C# and was happy to have found a usable Java - until I saw the probs Mono is facing porting .NET, particularly System.Windows.Forms, to Unix ... and the fact that they would always have toplay catch up, with no big company to support them (IBM, Sun and other Linux/Open source backers already have a huge stake in Java)
When I read about the proposed features for Java 1.5, I knew i could stick with Java for the long term. Good news!
C# invented them? Are you sure?
> > generics support
> C# innovated this, and already has this in the spec
C++ and Eiffel innovated this. Generics have been available for Java for *years* in this implementation ( http://www.cis.unisa.edu.au/~pizza/gj/ ). It just don't get accepted into Java right away. (BTW, Generics aren't currently part of C#, are they?)
> > autoboxing of primitives
> C# innovated this, already implemented years ago
LISP, C, heck even PL/I implemented this years ago.
> > syntactic sugar for loops
> "foreach": C# innovated and already has this, implemented years ago
Python, Basic, Smalltalk, and Perl did this years ago.
> > enumerated types
> Java didn't have this before? LOL
The new enumerated types aren't simple integers, they're more like Ada enumerated types. They're objects that can be used in switch statements. variable arguments. BTW, enums aren't really needed for most programming as long as you have constants. Many high level languages (e.g. PHP, Python?) don't have enums and there's no strong demand for them.
> > variable arguments
> C# innovated and already has this ("params array" arguments)
FORTH, LISP, and C had this for ages.
> > sharing of memory between multiple VMs
> C# already has this
Actually, this is more to do with multiple implementation sharing loaded classes. Currently Java startup times are slow because classes aren't preloaded or shared as they are on the Microsoft J# and MacOSX Java platforms.
> > and a bunch of other bugfixes, enchancements
> Bugfixes in a language? WTF?
Yes, bugfixes do happen. Oh, I forgot you live in the Microsoft world.....
Seriously, why is it when when C# cherry-picks good features from Java, it's called innovation but when Java learns from other languages it's called playing catchup?
Java has gone very far without these features and it still doesn't need them. They're fluff. The only feature that really needed to be added is the shared memory VMs since it'll solve the perception that Java is slow once and for all. The metadata feature is also nice, but it isn't really necessary. XDoclet had C#-like metadata for years (I believe before C# did). It just hasn't been recognized and officially integrated with the EJB spec.
While in general I agree -- the core implementations of both are closed source -- the two are entirely different when motivations come around.
Sun: Motivated to create a Java developer base and sell related goods on various platforms.
Microsoft: Motivated to create a C# developer base and sell related goods on Microsoft platforms (Windows NT and Windows CE lines).
While I don't entirely trust Sun, they have a much better history when it comes to trustworthyness.
All that said, the .Gnu and Mono projects are damn important. They are also doing a difficult task on an unreliable (and fluid) 'standard'^.
A firewall can not protect you from yourself. Turn off what you do not need. Do not use the firewall to do your work.
" Someone in Suns marketing department should produce a massive wallchart detailing everything Java can do, every major solution for it and arrows showing how they all join together and then mail it out to every CEO / CTO in the country."
Sun has a marketing department? Jeesh, its like saying Novell has a marketing department. This is one thing that companies need to really wake up and smell the coffee on. Although good products can sell themselves, they sell better with good marketing to entice the corporate types. Marketing is the reason why M$ is where it is today.
Thus you have a lot more choice. You could be using Java on Mac OS X, Tomcat and PostgreSQL to power your website, or you could be using IBM mainframes with WebLogic and an Oracle backend.
With
No. Type checking is stronger because you can avoid type casts. (Note, I'm talking about generics in general, not the Java implementation which is slightly broken because of VM compatibility problems).
What the hell are you talking about? Be more specific.
The lack of speed of virtual methods has NOTHING to do with processor technology. It is there because you MUST do a lookup at runtime (which there is absolutely no way to avoid). This will ALWAYS add overhead, regardless of processor technology. The only way to avoid this overhead while still having "reusability" is to have "compile-time virtual methods" (i.e. templates).
Now you're talking pure nonsense. What security holes? Generics AVOID security holes because they avoid typecasts (invalid typecasts are one typical reason for security holes).
Nonsense. Compilers are not slowed noticably down by generics in general. All functional programming languages support "generics" (type-variables is a more correct term), but the compiler for e.g. O'Caml is still as fast (or faster) than gcc is for C code. Compilers for C++ may be slower because of templates, but that's because the C++ templates are nothing more than macros with a little added type-checking (so the compilers usually have to compile lots and lots of extra code).
There is no such concept as "generics" in LISP -- since everything is dynamically typed generics are the default. If you're talking about macros, then some people may discourage them, but those people are idiots. Macros are the precise reason that the LISPs are so powerful.
HAND.
Because Java has freely available, industrial strength implementations on dozens of platforms. If you use it, you aren't locked in to deploying on any particular OS or hardware. (BTW, don't forget gcj in your list of "free" alternatives.)
I hope that helped clear things up...
Galileo: "The Earth revolves around the Sun!"
Score: -1 100% Flamebait
Have you tried jython?
/* ---- */
"Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform."
This means you can even run python on a palm pilot or a cell phone.
jython code can even be compiled into java bytecode (*.class files)
I believe that overall, much more time is spent maintaining code than in writing it, and yet languages seem designed mainly for the latter. (Perl particularly!) Some of the changes -- new for() loops, generics -- will improve readability and maintainability too, but I worry that the new imports, and maybe enums, won't. At present, it's fairly easy to look at a small section of Java code and know exactly what it's doing. With no preprocessor, and nice easy scope rules, you can easily tell what names and objects are being used -- that's one of the things I really like about the language. Additional imports, not just of class names but of other identifiers, risks muddying this. Has anyone done much actual work in 1.5 and can speak from experience?
Ceterum censeo subscriptionem esse delendam.
Java as a memory hog?
Yes, and without a lot of careful work this affects performance in real world medium and large size applicatins more than code execution speed.
Shared memory helps?
*Only if you run multiple programs simultaneously*
What is really needed for single program performance is object structure changes so that commonly used things (GUI elements, datastructures, threads...) within a single program share and save memory or are allocated and reallocated from pools automatically. Generally, this is more imporatant on the client-side but each situation is different.
Microsoft has it REALLY easy, and is cut way too much slack, when it comes to development environments and languages. They control the operating system and the hardware specifications and compliance. And, they have done so for well over a decade.
Java is truly platform independent, which is a huge challenge. That challenge was met with a well designed language that operated slowly. However, between 1.4 and 1.5 there are substantially speed increases in the VM which bring it up to par with the fastest languages available.
When you think about developing applications you need to consider many things other than pure technology:
..the list goes on.
- Who will be around in 5-10 years (both MS tech and Java tech will)
- Access to developers (while MS is the clear winner in the US, this is not so in other countries, where even gov'ts are against MS)
- Vendor independence and support (this is clearly in favor of Java)
"Ain't I a stinka..." - Bugs
I mean apparently some level of pressure from dotnet does show up... And that's good I think. Not that I like either of Java or C#... Both look too restrictive (without real benefits) and kinda old to me. I'm leaning more and more to move all the stuff I do to Python (i.e. where I may decide what to do it in, sigh). Slick, reliable, and just very nice to work with.
Java has binary portability (i.e. compile on Wintel and run that binary unchanged on Solaris), C's portability is at the source level (develop on Wintel recompile on Solaris). And even then it takes more discipline (not that programming discipline is a bad thing) to write portable C code than to write portable Java because of the abstractions you mention. If you want to write a program that interacts with the system at a low level then Java is the wrong tool for the job. JNI is awful. It gives you the disadvantages of Java combined with the disadvantages of C/C++. If you find yourself needing to use it you should reconsider your choice of development platform.
Suck figs.
Their basic tactic has always been "embrace, extend, extinguish" - not "steal, sue, squash".
You might want to talk to the many companies Microsoft has stolen from, notably Stac (I think was their name). Sue? Squash? Yep, sounds like Microsoft. You must be living in some weird dream world.
Infuriate left and right
Java is slow today in 2 main places:
[] because array references are bounds checked, and if you do anything more than minimal array work your bounds wont get hoisted so you're screwed for performance. Maybe the 1.5 compiler will hoist more references, the 1.4 misses a lot of obvious opportunities. Also, there are some optimizations that can be done on 64-bit architectures, so hopefully this will at least get somewhat better in a couple of years. It would be nice if they added an unchecked keyword or something to let the programmer decide when they want bounds checking.
Swing is pretty slow, and I don't see sun promoting any of the alternatives yet.
"Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
"That's only true for trivial applications."
Thats an exageration. My company sells several non-trivial Java apps which are binary portable. While we've encountered some platform inconsistancies, particularly in networking, its been fairly trivial to find ways to make things work portably.
Don't whine at Sun my friend...go the the HP site and get the JDK from them...they may have even released a 1.4 version by now...
Oh BTW, since Sun itself only directly supports Linux Solaris and Windows with all of it's other software, you should not be surprised when they don't release a BETA on another platform. *BSD may be good, but Sun are not experts in *BSD. When The 1.5 SDK is final, I'm sure you will see a quick release to *BSD, jsut as there is a 1.4x fro *BSD now (actually maybe only NetBSD but there is one....).
You see, unlike some other software giants, Sun will let other companies and organizations port Java to their platform at their own speed since they are the experts not them...
Never by hatred has hatred been appeased, only by kindness - the Buddha
are given, something C++ does not (at least not explicitely).
murphee
It's a convenience, to be sure, but it seems to me that autoboxing is a setup for programmers to make mistakes, as certain classes can get automatically and invisibly created, where before there would have been an error message issued by the compiler. Hopefully there's a command line switch to disable it so that the compiler can still catch those errors.
Everything else in 1.5 I absolutely love.
File under 'M' for 'Manic ranting'
Are you sure those different packages weren't just for ease of deployment (an .exe installer for Windows, RPM for Linux etc.)?
I have never known an issue in a (100% pure) Java program that relates to what platform it was compiled on. What platform it executes on, certainly, but not on what platform the build was done on. The compiler either produces valid byte code or it doesn't. There's no issue such as byte code being valid on Windows but not on Solaris.
If I compile with a 1.4 compiler on Windows it will run on a 1.4 VM on Windows, Solaris and Linux without recompilation. I may occasionally find that my threading or I/O behaves slightly differently because I haven't accounted for subtle differences inherent in the underlying OS (not as big an issue as when coding in a natively compiled language), but that's not because the byte code is not compatible across different platforms.
Suck figs.
I find it hard to imagine that anyone is still using Swing these days unless they are locked in to it,
SWT doesn't come with a MVC approach as Swing does. Besides, you'll have to deallocate your GUI resources with SWT yourself.
SWT is the future of Java GUIs
That's a very bold prediction. SWT is a valid alternative in some cases. Before picking a GUI one should think a bit about which toolkit is best-suited for the job. But in no way is SWT always the right choice.
We recently switched from Java Servlet development to ASP.NET, and ASP.NET is MUCH faster to develop in. Yes, I know that we're locked in to MS OS and server, but given the incredible productivity increase, this is a small price to pay.
All things being equal, I'd much prefer to stay away from MS. But ASP.NET is far too superior a way to go.
It looks like the new Java release finally makes it roughly as good as C# (or Delphi, after which C# is modeled), but more is needed to for the Java world to be as efficient as the ASP.NET world:
1. A good IDE. In ASP.NET, I can drop components on an HTML form, which bypasses a lot of HTML grief. The entire paradigm is easy-to-use and integrated. In Java, I need to use the comparatively awkward Eclipse or Forte IDEs, muck with Dreamweaver and whatnot - it's a productivity-destroyer.
2. Servers that are not obtuse. I can get IIS to do anything in about 5 minutes. It takes hours or days to do anything in Tomcat or Resin and Apache. My time is precious.
Are you serious??
You should try to do some netowrk programming, say for example real time analysis of netowrk packets, see if java can handle a gigabit network...I didnt think so.
I work for Yahoo. Many of our web servers are powered by Java, and they're fast enough for us. Are you suggesting that your network performance needs are higher that frickin' Yahoo's?!?
I do freely admit that we don't use Java for the super-high-volume stuff like My Yahoo and Mail. But we're Yahoo. Even our low-volume properties are high volume. Java is fast enough to serve a lot of purposes around here.
ZFS: because love is never having to say fsck
C is portable all right - assuming you love the preprocessor.
...
... ...and so on. Yuck.
#ifdef SPARC
#endif
#ifdef X86
#endif
I get the point how .NET developers would be screwed, but if Sun stopped distributing Java I could continue to use IBM's very high quality JVM, or BEA's JRockit, or Apple's OSX. No doubt one of the many others would quickly step up to fill the void. None of these can disappear at the hands of Sun.
If .NET went away at the hands of Microsoft, it would likely disappear entirely because of its immaturity. Java, on the other hand, has reached the point where it could live on independently if necessary.
If Sun or Microsoft stopped shipping a C++ compiler, the language would live on. Java has reached that point too.
Dynamic typing being a Good Thing depends on the context. Dynamic typing tends to move more bugs which could easily be caught at compile time to runtime. This means more testing needs to be done which actually drives up development costs and thus negates any benefit gained from "rapid development".
Indeed, I find that writing test suites saps much of the development speed advantage I gain from using a dynamically typed language.
However, using a soundly designed dynamic language, I can write dynamic-implementation+test-suite in about the same time I could write only static-implementation in, say, Java. But since I have an extensive test suite, I end up with much more reliable code.
Erlang.org: wow
The point is that the typechecking in Python is done at runtime (obviously). Having to *declare* the types of all variables/members/parameters allows to check for correct types without having to write test-cases that cover *every* possible path of execution (which, in general, is impossible anyway, especially if lambda-statements are involved).
Forcing programs to be type-save weeds out a lot of potential bugs beforehand. And it makes reading the code a lot easier.
I have discovered a truly remarkable sig which this 120 chars is too small to contain.
Sun wasn't working on the language because they were busy building up the libraries--arguably a better choice. Instead of generics and autoboxing, we have J2EE, which (in the right parts) is probably a larger productivity gain. One place Java still has a huge advantage over ASP.NET is the size of the standard libraries/APIs.
Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
Absolutely, competition is good. On the other hand I think Java itself was a good motivation for developing .Net. I don't think MS would have been as eager to put development and research resources into it otherwise.
.Net support in eclipse.
This is what competition is about. MS already has C# 2.0 designed (which sports many of the features introduced/present in jdk1.5) and no doubt they'll start marketing that in a couple of months. It's a technological arms race. Of course the big question is which of the two will make the first move to support the other. My guess is that they will let IBM do the hard work. Already there is some
Jilles
I can understand and respect a firm position on open standards and non-proprietary technologies, and that's fine for some folks. On the other hand, I have no problem with Java's licensing or ownership encumberances, and I know I am not alone. The source is open enough that crucial problems, even in the VM, can be fixed by me (rather than begging and whining and being ignored for years, or writing ugly workarounds). In practice I have no issues at all. Certainly, Java compares favorably to things like .Net on this score.
Some thoughts:
Java genericity has no special support in the runtime, which limits the type safety it can provide.
True.
Generics over primitive types are boxed, meaning they are inefficient.
Collections were already boxing primitives. How often do you think this will come up for you in the real world? Can you come up with a convincing example?
Java's native code interface is still inefficient and complex.
Funny, I've used it for a few different things (in 1.4) and never found it to be either. But perhaps if you made a more specific complaint...
Java still lacks value classes and operator overloading, making it a poor choice for applications involving numerics or graphics.
Pardon my ignorance about value classes; I'm wondering if you can be more specific about when they're really useful and what benefits they have for numerics or graphics?
And finally, when you say operator overloading, you lose me. My opinion of operator overloading is that it is absolutely bad. Let me be clear. It is always bad, under any circumstances, when used for any reason. It has exactly zero functional value, and, as opposed to other kinds of "syntactic sugar" it has a tendency to make code where it is used with any frequency into a confusing, unmaintainable minefield. When advocating for operator overloading you are basically advocating a programming style with 1 letter method names, only it's worse, because you're limited to a few "commonly used" letters.
Want to Know How to Cheat the GPL? Read On!
Of course, IMNSHO the whole "Java 2" name was just marketing run amuck. I don't see how it's done anything but cause confusion. If marketing absolutely insisted on having a "Java 2", engineering should have bumped the version number to 2.0.
I'm not a fan of marketing determining version or release numbers, nor version number inflation, but changing a marketing product name to include something that looks like a version number without having it match the actual engineering version number is obviously bad.
In many languages nowadays, be it fortran, c++, perl, python, etc. etc. etc. it is possible to use straight math operators on arrays or matrices, which has a clear and concise syntax that everybody that learned math understands. This cuts down on the code to write, the formula is clear and can actually be looked up in the original paper if you care, and, the libraries are usually pretty well optimized. Compare this with java, where, if you use a matrix library, you get some cooked up API that doesn't resemble the way you think about arrays of numbers at all.
Okay, as you seem to claim that operator overloading is absolutely bad always, please explain why:
matrix c = a + b - c;
is bad, and
String c = a + b;
is considered acceptable? Hell, the addition operator on strings isn't even associative.
Just skip this and program in much better JVM based languages than Java:
Admittedly, I didn't even bother to look at either of the languages you point to, but it's irrelevant. Here in the real world, popularity matters. You could be using the best damned programming language in the entire world, and if you're the only one using it, good luck finding a job.
I'm not saying that we should hold back progress. If these languages are really better than Java, then by all means support them and encourage people to adopt them. That's not where you're wrong. Where you're wrong is saying that people should "skip" Java for these languages. That is, quite simply, insane, at least if you're trying to program for a living.
ZFS: because love is never having to say fsck
My beef with Java is that the Sun SDKs are such a pain in the ass to download from a command prompt.
They use some extremely arcane methods to make sure you have to agree to their licence (which is fair enough) but then once you've started downloading, you can't pause and resume! I even tried their stupid download manager, and it couldn't deal with it.
For those of us on modems (and have ISPs who boot us off every 2 hours to avoid hogging), this is really annoying. I had to get a friend with broadband to download it, then upload it to my FTP server.. so I can stand a chance of downloading it properly!
All they hear at the seminar is that ".NET has a portable runtime just like Java and offers an end to end solution". And then the brain disengages without detecting the ambiguity. How many ask for clarification - the runtime might be portable but has it been ported and what about the rest, is that portable and ported too? Of course any company switching over might learn their mistake when it is far too late to correct. This premise also presumes Java needs replacing when it rarely does for any reason, especially not to another runtime language.
Even the client side stuff in .NET like the Forms demonstrates there is no portability there. Look at the hoops that the Mono folks have to do to support it - linking to Wine no less. In other words, to implement Forms (and PInvoke) you have to emulate an entire Win32 API!
And there is the constant threat of harrassment hanging over the project if ever it gets too good for Microsoft's liking.
This is why I think mono is wasting its time really pursuing .NET libs. Support for semi-core libs such as Forms might be okay but draw a line in the sand. Offer a viable alternative in GTK# and other open technologies which give people no reason to use windows.forms. Better yet, implement plugins for Eclipse which make it easy to visually design and build apps for GTK# that run on any platform.
After all, DevStudio used to be a premier development platform but these days it is looking distinctly ropey especially for the fortune it costs. With a bit of coaxing Eclipse could do everything DevStudio offers but with the added benefit that the code it produces truly runs anywhere
That's funny -- it seems that in another 4-6 years the language features of Java will approach those of Common Lisp.
The main difference being that CL is standardised and thus isn't a moving target -- you don't have to worry about the language changing from under you every once in a while. You can concentrate on your libraries and applications.