Fog Creek Software
Discussion Board




Java 1.5 – a huge philosophical shift for Java

http://java.sun.com/features/2003/05/bloch_qa.html

This is a major turning point in the philosophy of Java.  The changes in 1.5 make it natural to write much more concise, but less beginner-readable Java code.  When I first started using Java, I liked how there was (almost) total separation between the grammar and the APIs, and that everything was explicit.  But the resultant logorrhea began to annoy me after I got good. 

Post 1.5 Java – let’s call it New Java – blurs the line between language and API.  The enhanced ‘for’ loop, for example, knows the  Collection interface and calls methods on it.  New Java feels more like C in its embrace of brevity.  This is great - a language ought to sacrifice a little readability to beginners to multiply the productivity of experts. 

Let’s give credit to MS: I think the emergence of C# and .NET was key in putting competitive pressure on the Java guys to be flexible on this issue.  I’m glad there is finally some tough competition for Java, and I think this shows how developers in both camps will benefit.

Between Java 1.5 and the new Java IDE (IntelliJ Idea) that is even better than VS.NET, I think we are beginning the Golden Age of Java. 

Hope this hasn’t been too breathless for everyone, but I am pumped up! 

Ethan Herdrick
Friday, May 09, 2003

Finally!  What took them so long.

One of my biggest pet peeves with Java is the treatment of primitives vs. objects -- like having to wrap them to put them into a Collection and unwrap them after extracting them from a Collection.  Thank goodness this next release addresses that.

T. Norman
Friday, May 09, 2003

I am stoked as well.  My biggest frustration is that I have to wait until fall to begin using 1.5.  I see these improvements as really speeding up my development.  I really am beginning to C emerge in JAVA again, and that is a good thing.

Bob, in Kirkland
Friday, May 09, 2003

I wouldn't say huge, but seems nice, and I would say readability isnt that big an issue

Daniel Shchyokin
Friday, May 09, 2003

No- this is huge and focusing on readability would make ity seem small.  The few changes they are making to the language are little things which I must admit have been annoying me for some time.  The fact that collections are class aware now will save a lot of typing, and more importantly, help to constrain things at compile time which normally would have to be dealt with at runtime.

I also think this shows that despite complaints about Sun's stewardship of Java, on the average it is working well.  I believe that giving it to a standards body early on would have seriously slowed advancement of the language.  These latest changes indicate to me that the java community process is working reasonably well.

Slightly off topic, I think this is also a good thing for Microsoft .NET people.  I know we all like to bash other's tools, usually in at least partial ignorance, but we must admit that competition for developers is a good thing.  Java forced Microsoft to develop .net and C# and those two things will light a fire under Java's ass for the next few years. 

Erik Lickerman
Friday, May 09, 2003

Now if they made swing or awt a credible ui, that would be HUGE, this is lipstick on the pig that will stave of carpal tunnel syndrome for a few months

Daniel Shchyokin
Friday, May 09, 2003

I'm just stoked about the addition of generics to the language. I think the lack of generics in java and c# (and thus built-in type safe collections) is one of the biggest problems with the two languages.

Andrew Murray
Friday, May 09, 2003

Except maybe for the generics and the <> syntax, I think these changes will *improve* readability, not make it worse.

Many sore eyes and fingers will be glad for the removal of the need to do explicit casting when retrieving from a Collection.

T. Norman
Friday, May 09, 2003

Ethan wrote:

>Between Java 1.5 and the new Java IDE (IntelliJ Idea) that is even better than VS.NET, I think we are beginning the Golden Age of Java. 

It may be your opinion that IntelliJ IDEA 3.0 is better than VS.NET - but I'm going to assume you haven't used VS.NET extensively ;-)

For all that microsoft does wrong (and the list is long), VS.NET 2002 & 2003 are by far the best IDEs I've ever had the pleasure of working with. 

Yes, I've tried IDEA recently.  It's definitely nice compared to all the other crap out there.  With the exception of SlickEdit (which I've been using since v4.0) - the only problem with SlickEdit is that there's no integrated web app debugger.

Until I can concentrate on the "software development" part of developing java web applications rather than modifying x configuration settings in the IDE to get it to play nice with the app server (debugger), deploy applications, set up connection pooling, etc. - I'm sticking with C# & ASP.NET.  Anyone tried Websphere Studio App Dev. edition? It integrates a preconfigured Websphere App Server within the IDE.  Great, if it didn't take up an insane amount of RAM and take a couple of minutes to load.  And as an IDE, it pales in comparison.

So, yeah, Java/J2EE may be 'open' and 'cross-platform' and 'not microsoft' and blah blah, but until it just works without alot of extra b.s. steps, Microsoft will keep gaining ground. Wow, sorry to rant ;-)  I'm not an evangelist of MS stuff, I just like tools that 'just work'.

GiorgioG
Friday, May 09, 2003

"Let’s give credit to MS: I think the emergence of C# and .NET was key in putting competitive pressure on the Java guys to be flexible on this issue."

More to the point, is there any change in this list that wasn't copied straight from existing or planned C# features?

But I'm not complaining, after all C# cloned Java to begin with. ;-)

Chris Nahr
Saturday, May 10, 2003

Jeeze guys,

All these "VS.NET > IDEA" people sound like the Eclipse people... i.e. JUST-PLAIN-WRONG.

Use IDEA properly THEN make your comments. I'd be surprised if you disagree with Martin Fowler, Jason Hunter.... and the ever growing list of IDEA advocates.

Yes, religious arguments are stoopid, but I actually have seen God... it's an IDE manufactured by a company called JetBrains. Sometimes goes by the name of IDEA.

Walter Rumsby
Saturday, May 10, 2003

I suppose I have to say this every time someone says the opposite so to repeat- Swing is not only a "credible" GUI it is a very good one.  If you haven't used it in a few years, give it a try again.  It's not quite as fast as native Windows but seems to me as fast or faster than, for example. GTK.  Yes it isn't as easy for beginners to make fast responsive apps as, well I dunno whatever you are claiming is better, but for the experienced developer it is great- a real pleasure to code to.  Give it a try again

Erik Lickerman
Saturday, May 10, 2003

>All these "VS.NET > IDEA" people sound like the Eclipse people... i.e. JUST-PLAIN-WRONG.

Please tell me what IDEA does other than add refactoring support that VS.NET does not do? (3rd party plugins for refactoring are available by the by.)

>Use IDEA properly THEN make your comments. I'd be surprised if you disagree with Martin Fowler, Jason Hunter.... and the ever growing list of IDEA advocates.

Use IDEA properly?  What the f*ck does that mean? 

http://www.intellij.com/idea/features/features.jsp

Outside of refactoring, which I've already mentioned, the only feature that I couldn't find any equivalent for in .NET was the built-in "Local Version Control" which is only marginally useful.

>Yes, religious arguments are stoopid, but I actually have seen God... it's an IDE manufactured by a company called JetBrains. Sometimes goes by the name of IDEA.

You know, that's the least intelligent statement I've seen recently on here.  Going to have to save that one.

I've used both IDEs (VS.NET & IDEA), and VS.NET is more responsive and better integrated with the environment (for obvious reasons) - IDEA is neither light-years behind or ahead of VS.NET.  So lets please argue about something else, because we're comparing a ferrari to a lamborghini.  It's unlikely that there's a noticeable difference.

GiorgioG
Saturday, May 10, 2003

I've never found it fair when someone says that only bad programmers make slow Swing apps. ;)  Trying to argue makes you look bad.

Is it only about the mistake of putting too much in the event queue?

Someone should write a Swing app that is considered "responsive."  It shouldn't need installation, so it should have a stripped JVM in a subdir.  Then people can critique for themselves.

Tj
Saturday, May 10, 2003

from the article

>Autoboxing/unboxing - Eliminates the drudgery of manual
>conversion between primitive types (such as int) and
>wrapper types (such as Integer).

- even the terminology sounds like .net (boxing,unboxing)
- metadata facility looks like .net attributes
- Wow! Sun even added enum type. I am impressed.

Both platforms (java .net) are converging. i would call the result jnet.

Now what happens with J# after JDK 1.5 ? - Microsoft can't add generics to J# because they are stuck with the Java 1.1 syntax. (legal problems i guess).

Michael Moser
Saturday, May 10, 2003

"Now what happens with J# after JDK 1.5 ?"

They no longer need it since C# will be mostly compatible with Java 1.5 anyway? ;-)

But J# isn't exactly the most vital language anyway. I think most people are still wondering why MS even bothered.

Chris Nahr
Saturday, May 10, 2003

> - even the terminology sounds like .net (boxing,unboxing)

My God, what an uneducated comment!

Shocked
Saturday, May 10, 2003

>But J# isn't exactly the most vital language anyway. I
>think most people are still wondering why MS even
>bothered.

i think it had a point - give Java people a chance to try out .net, and leave them the option of switching back, 
so that if you want to switch back to java then you don't have to rewrite your business logic again.

Michael Moser
Saturday, May 10, 2003

To expand on what "Shocked" said: the terms "boxing"
and "unboxing" are way, way older than .NET; for instance,
they're used in the paper "Performance of Lisp systems"
by Gabriel & Masinter published in 1982. "Arithmetic is
complicated because Lisp passes pointers to Lisp numbers
and not machine format numbers. Conversion to and from
pointer representation is called boxing and unboxing,
respectively."

Gareth McCaughan
Saturday, May 10, 2003

I stand corrected.
Lisp - the Mother of all Java's.
wait, did they have a class loader + class file format too ?

Michael Moser
Sunday, May 11, 2003

TJ- I think it is a combination of things.  The first is not having used swing recently.  Swing now has access to your graphics card which speeds things up considerably.  The second is not using threading when doing time consuming tasks.  Swing does not handle this automatically and it is not trivial.  There is a project called FoxTrot, which I haven't tried yet, which attempts to do this.

Another factor is assuming that using the base line components will be performance adequate.  Example:  The toolkit has an HTML component which is fine for simple tasks but if I were writing a Java based web browser (not sure what the point would be) I would probably spend most of my time writing my own HTML component.  THis isn't so odd really.  Opera, Mozilla, Konquerer- they all roll their own and optimize the crap out of them.

Another problem is comparing to native windows apps.  They are always faster and make the Swing apps seem slow in comparison even though the "sluggishness" of the swing app might not prevent you from doing your work in any way.  I look at it kind of like getting better stereo equipment.  If you blow $10000 on a stereo, after a week or so you will not enjoy it much more than your old $1000 stereo, but if you go back to it, it will sound like crap.

It seems to me that a well written Swing app runs on a new computer, about as fast as a well written native app on, say, a 3 year old computer.  It seems to me that if Swing is inadequate to do your work, then a three year old computer is too.

BTW, my mother runs windows XP on a five year old computer and that seems really slow to me- the start menus takes a few seconds to open.

erik lickerman
Sunday, May 11, 2003

GiorgioG,

You say - "http://www.intellij.com/idea/features/features.jsp".

I'll tell you what. It's not a list of features that makes a difference - after all, if we take humans, for example - they all have the same list of features, but some of them you like and some you don't.
The same goes about IDEs, I think. I'm attached to IDEA on the emotional level - it does everything I ever need or want with a most elegant and simple way or shortcut. So far - there was nothing I wanted to do and didn't see some tooltip explaining me how. I just feel warm and comfortable working with IDEA, like with an old friend who always silently understand your needs (see, I'm getting emotional :).

JetBarins people must be crazy about usability and I give them "best development tool in my life" for that.

May be you feel that way about SlickEdit (didn't like it) or VS.NET (never saw it) - but don't show me a list of features asking "What X doing that Y can't do ?". I don't care about Y or Z, I hust love working with IDEA. You may try it, you may not - forcing you to shouldn't be an issue.

Evgeny Goldin
Sunday, May 11, 2003

Who cares wether "they copied it all from C#" or that ".NET is just the MS JVM clone". Great to see progress on both fronts.

Just me (Sir to you)
Monday, May 12, 2003

Oh, and it should be noted that .NET 2.0 is definitely going to have runtime generics in it, so it remains to be seen whether this really is a leapfrog or not (since I imagine both Java 1.5 and .NET 2.0 are probably ~ 9-12 months from GA).

Brad Wilson (dotnetguy.techieswithcats.com)
Monday, May 12, 2003

I've never found it fair when someone says that only bad programmers make slow Swing apps. ;)  Trying to argue makes you look bad.

Is it only about the mistake of putting too much in the event queue?

Someone should write a Swing app that is considered "responsive."  It shouldn't need installation, so it should have a stripped JVM in a subdir.  Then people can critique for themselves.



http://www.jgoodies.com

There.  Point proven.

anon
Monday, May 12, 2003

>http://www.jgoodies.com
>There.  Point proven.

I'll give you that it's more responsive than any other Java app I've ever seen/used.  I find it to be a bad omen that in 8 years, there's probably a handful of applications that have been made using Java that are responsive/crisp enough to be able to forget that you're using a Java app.

That said, the app still takes longer to load than a native (or .NET) application... but alas that's the JVM's fault.  Impressive by comparison to other Java apps nonetheless.

GiorgioG
Monday, May 12, 2003

>I find it to be a bad omen that in 8 years, there's probably a handful
>of applications that have been made using Java that are
>responsive/crisp enough to be able to forget that you're using a Java
>app.

But then one can claim that it takes eight years of
java experience to write such an application ;-)

Michael Moser
Monday, May 12, 2003

Wicked fast, even on java 1.3.  Faster than Moz, probably even Phoenix.

The only problem is that it doesn't know about my scroll wheel's acceleration (java 1.4.1_02).  In some of the demos it's even unusable.

However, it seems to work very well with system font settings, at least if you coax it.  Better than a lot of native programs.

Cool how it has a framework for eager and lazy loading.  I did adhoc versions of these things when I worked with Swing.

Hope Karsten's making out like a bandit, I definitely would have been all over his reasonable source license.  Sun should hire him (like they're doing a lot of that now).

Tj
Monday, May 12, 2003

btw, I didn't do any deeper testing than messing with system settings and checking mem consumption running 5 instances while running music, www, mail, and vnc, so ymmv.

Tj
Monday, May 12, 2003

GiorgioG have you used Eclipse? Thats all.

Mr Bloh
Tuesday, May 13, 2003

Mr. Bloh,

Yep - tried Eclipse, wasn't too impressed.  I believe it's what Websphere Studio is based on (also not too impressed with the dev tools in Websphere Studio)

GiorgioG
Tuesday, May 13, 2003

I've tried a lot of IDE's for both Java and C++ and I think Eclipse it best IDE ever created, because Eclipse programmers use it for their own programming and so they really know what is needed. Try Eclpise and you never will want anything else.

Clever
Tuesday, March 02, 2004

*  Recent Topics

*  Fog Creek Home