[java] Java 1.4 or Java 5?

Started by
13 comments, last by pinacolada 18 years, 9 months ago
I would go with 1.4 for now. You probably won't need of the features from 5 if you have never programmed in java yet. You can worry about switching to 5 later on down the road.
Advertisement
...
I think most everyone missed out on one of the most important issues when choosing which version to use: market saturation.

Simply put, there are far more computers out there that have JRE 1.4 than 1.5 (5.0). If you want your code to have the most compatibility, use 1.4. However, I'm sure that about a year from now, anything less than 1.5 will be a joke, but it's always something you need to plan for.

I can say with high certainty that most businesses do not use 1.5. Takes too much time to upgrade something that is rarely used anyway.

If, however, you don't care about this stuff, and want to learn Java as it is today, use 1.5. (I suppose it's wholly dependent on what your textbook is teaching). It's not like they're going to remove Generics or anything in a future release (I hope not anyway) without breaking a lot of stuff. Sun has been keen on maintaining backwards compatibility (mostly, I'm sure some of you can cite examples where your code broke).

So there you have it.
I recommend learning both, and probably learning 1.4 first. Like was said above, 1.5 has some nice features (mainly syntactic sugar) that can help you develop a bit quicker in some instances, but learning 1.4 first will probably help you see what's going on behind the generics and autoboxing, etc. It seems like one of the things that slows people down when trying to learn about any computer-related subject (not just programming) is not knowing what's actually going on under-the-hood and then getting unexpected side-effects as a result. Try each one out a little bit though and go with what feels natural and what you can grasp easiest.
I love the 1.5 features. Doing a foreach loop through a generic container is FUN!

But anyway, if your class is using 1.4 then you should stick with 1.4. Might want to ask your professor about this, I'm pretty sure that he will tell you that in-class assignments will be required to be in 1.4.

This topic is closed to new replies.

Advertisement