The Artima Developer Community
Sponsored Link

Weblogs Forum
Java: Evolutionary Dead End

92 replies on 7 pages. Most recent reply: Jan 3, 2008 12:06 PM by Bruce Eckel

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 92 replies on 7 pages [ « | 1 2 3 4 5 6 7 | » ]
Casey Watson

Posts: 1
Nickname: cwatson
Registered: Jan, 2008

Re: Java: Evolutionary Dead End Posted: Jan 3, 2008 6:05 PM
Reply to this message Reply
Advertisement
> Fundamental new features should be expressed in new languages,
> carefully designed as part of the ecosystem of a language,
> rather than being inserted as an afterthought.

You make a very good point. Though I haven't spent much time with it, C# seems to be a very progressive language. There are always hip new language features on the horizon. Do you feel that a lot of these features have been hacked in? Or have they managed to maintain a level of good design as the language has grown?

james richardson

Posts: 1
Nickname: time4tea
Registered: Jan, 2008

Re: Java: Evolutionary Dead End Posted: Jan 3, 2008 6:12 PM
Reply to this message Reply
Does this post matter?

How many people have Sun got working on the Java JVM to implement all these new language features?

I heard Google hired them all away...

Bruce Eckel

Posts: 875
Nickname: beckel
Registered: Jun, 2003

Re: Java: Evolutionary Dead End Posted: Jan 3, 2008 6:53 PM
Reply to this message Reply
> You make a very good point. Though I haven't spent much
> time with it, C# seems to be a very progressive language.
> There are always hip new language features on the horizon.
> Do you feel that a lot of these features have been hacked
> in? Or have they managed to maintain a level of good
> design as the language has grown?

In general I've been impressed with the way C# features have been designed into the language; it feels much more considered. They have the advantage of learning from Java's mistakes, of course. But Anders Hejlsberg has long experience with language design, and it shows.

Although C# generics are cleaner, they still do some erasure and do not allow full generic-ness (in the way that C++, Python and Ruby do) so I'm not thrilled with those.

If I knew I was only ever going to program on Microsoft platforms, C#/IronPython/IronRuby would be no-brainers.

Christopher Smith

Posts: 1
Nickname: cbsmith
Registered: Jan, 2008

Re: Java: Evolutionary Dead End Posted: Jan 3, 2008 7:33 PM
Reply to this message Reply
I agree with most everything that was written here except the notion that generics were "rushed" in to the language because C# was getting the feature. Generics in Java was discussed before Java was ever released, and the Pizza compiler guys worked on it (as well as other FP features) for years, before they were largely hired in to Sun to continue the work in the form of Gj. Gj's feature set was actually dumbed down in an attempt to make it in to JDK 1.4 (which would have allowed nio's "Buffers" to be genericized instead of the ugly mess of classes we have today). Unfortunately they got vetoed from JDK 1.4 by someone on the JCP committee at the time, reportedly because they were worried they wouldn't be able to support Generics in their IDE quickly enough.

Taylor Cowan

Posts: 10
Nickname: taylorc
Registered: Nov, 2003

Re: Java: Evolutionary Dead End Posted: Jan 3, 2008 7:49 PM
Reply to this message Reply
I disagree with all the anti-generics sentiment. Many people seem to think that if it's in the language, it must be completely and fully mastered by every developer engaged in using it. That philosophy applied to languages would required children to refrain from speaking until they were in their twenties.

Generics are best when applied carefully to a library or api. The client code becomes cleaner. The library is easier to work with because you don't have to run a test to figure out what's in the ArrayList of java.lang.Object's.

The person using the library doesn't need to know the details, the IDE will happily add ArrayList<MyClass> for you, and off you go.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Java: Evolutionary Dead End Posted: Jan 3, 2008 8:32 PM
Reply to this message Reply
> I disagree with all the anti-generics sentiment. Many
> people seem to think that if it's in the language, it must
> be completely and fully mastered by every developer
> engaged in using it. That philosophy applied to languages
> would required children to refrain from speaking until
> they were in their twenties.
>
> Generics are best when applied carefully to a library or
> api. The client code becomes cleaner. The library is
> easier to work with because you don't have to run a test
> to figure out what's in the ArrayList of
> java.lang.Object's.
>
> The person using the library doesn't need to know the
> details, the IDE will happily add ArrayList<MyClass> for
> you, and off you go.

You seem to be misunderstanding the criticism. It's not against the concept or utility of generics in general, it's specifically about the java generics implementation. Java generics are vastly more complex than they strictly need to be and the implementation contains a number of pitfalls. The biggest problem is the optional nature of generics in java and the lack of a way to use generic arrays safely.

In terms of whether everyone needs to master them, I think that's a little off the mark. Java's 'brand' has always been that it's a pretty simple language to learn. Few surprises and sparse syntax options. I have pretty much the entire pre-1.5 language in my head. Now it's a monster. The size of the JLS has increased a great deal. It kind of eliminates one of the big reasons to use Java. There are a lot of equally (and maybe even less) complex languages that offer a lot of useful things that Java lacks. Without the simplicity, there's not a lot of reason to continue using Java, especially when there are languages like Scala that allow us to continue to use our existing Java code and the vast array of libraries for Java.

Taylor Cowan

Posts: 10
Nickname: taylorc
Registered: Nov, 2003

Re: Java: Evolutionary Dead End Posted: Jan 3, 2008 9:55 PM
Reply to this message Reply
> Without the simplicity, there's not a lot of
> reason to continue using Java, especially when there are
> languages like Scala that allow us to continue to use our

If you are limiting the discussion stricly to Scala then I can follow the logic, but if, as we have in this discussion, brought along Ruby then point is completely lost to me.

I've enjoyed working with JRuby and had some fun seeing how terse you can be, but it's anything but simple, especially when you dig into some of the metaprogramming magic that's being done by things like Rails. Everybody keeps showing me how cool the attr_reader stuff is, heck, you can write your own attr_* thingies that do all sorts of wonderment in about 10 minutes. When I press ctrl- and mouse over language elements, my eclipse ruby cannot figure out where to go, often landing on a method with the same name but in the wrong module. And I have empathy for the ruby IDE, as I have the same trouble, it's all so vague and mysterious...and I get this Deja vu feeling I had 10 years ago working on a large perl project.

If we're all going to start writing Scala I'm all for it, anything but PERL by another name.

John Zabroski

Posts: 272
Nickname: zbo
Registered: Jan, 2007

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 12:02 AM
Reply to this message Reply
@Frank Sommers
@That brings up an interesting point, something that, I think, Plato also alluded to in the "Ship of Theseus:" At what point is a thoroughly re-designed language the same as the original language, and at what point would you consider that a new language? I think that at some point you need to call that radically rethought language something else, and leave the old language intact, as Bruce writes in this post.

Well, Python 3.0 is called Python 3000... I suppose adding 2998 version numbers automagically to a project is one way to indicate a huge change.

Jörn Zaefferer

Posts: 22
Nickname: jzaefferer
Registered: Jul, 2007

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 5:32 AM
Reply to this message Reply
> Now it's a monster. The size of the JLS has increased a great deal.
> It kind of eliminates one of the big reasons to use Java.
> There are a lot of equally (and maybe even less)
> complex languages that offer a lot of useful things that
> Java lacks. Without the simplicity, there's not a lot of
> reason to continue using Java, especially when there are
> languages like Scala that allow us to continue to use our
> existing Java code and the vast array of libraries for
> Java.

I think one of the best examples where Java is unnecessary complex are primitive values. I can't put an int into a List, so I have to convert it to an Integer - which is now accomplished automagically by autoboxing. But an Integer can be null, an int can't, is that also somehow affected by autoboxing?

Scala is much less complex there: Int and int are the same, both compile to Java's int and all operations are actually methods of Int, but can be written as normal operations because Scala allows method calls as infix syntax.


About the uglier generic definitions, consider this example:
Map<String, List<Integer>> entries = new HashMap();


Now, the compiler gives me a warning and to fix it I'd have to repeat the generic definition:
Map<String, List<Integer>> entries = new HashMap<String, List<Integer>>();


I think that warning is completely pointless, redudant. And duplicate code. I doesn't matter if I use HashMap without a generic type or with, the result is the same: Map<String, List<Integer>>, and thats all what matters.

My solution to the problem: Turn of warnings about unsafe generic blabla operations in my Eclipse IDE, and telling coworkers to do so, too.

I'd welcome if that warning is fixed, so that it warns me about using Map without the generic type.

Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 7:56 AM
Reply to this message Reply
do {

Dammit! Our last project was a failure (and it started out so well). Things were fine at the beginning, when the code and user base was small and we all knew all of it. The trouble was the new requirements and the developer turnover. In the end I just legged it and now maintenance team keeps it alive.

Anyway, I know our next project will be a success. We've learnt our lessons. There's this new methodology that changes everything and means that we'll be able to do it properly this time...

} while (!retired)

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 9:30 AM
Reply to this message Reply
> I think one of the best examples where Java is unnecessary
> complex are primitive values. I can't put an int into a
> List, so I have to convert it to an Integer - which is now
> accomplished automagically by autoboxing. But an Integer

> About the uglier generic definitions, consider this
> example:
>
Map<String, List<Integer>> entries = new
> HashMap();


This should be allowed and I think there's an RFE out there for it. It would be nice but don't hold your breath. You can actually do some fancy magic with factory methods but seems like overkill to me.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 9:33 AM
Reply to this message Reply
> I think one of the best examples where Java is unnecessary
> complex are primitive values. I can't put an int into a
> List, so I have to convert it to an Integer - which is now
> accomplished automagically by autoboxing. But an Integer
> can be null, an int can't, is that also somehow affected
> by autoboxing?

With autoboxing, you can now get NullPointerExceptions that are reported as coming from lines that are not lines of code in the source. It used to be you could always count on the stack trace.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 9:44 AM
Reply to this message Reply
> > Without the simplicity, there's not a lot of
> > reason to continue using Java, especially when there
> are
> > languages like Scala that allow us to continue to use
> our
>
> If you are limiting the discussion stricly to Scala then I
> can follow the logic, but if, as we have in this
> discussion, brought along Ruby then point is completely
> lost to me.

> I've enjoyed working with JRuby and had some fun seeing
> how terse you can be, but it's anything but simple,
> especially when you dig into some of the metaprogramming
> magic that's being done by things like Rails. Everybody
> keeps showing me how cool the attr_reader stuff is, heck,
> you can write your own attr_* thingies that do all sorts
> of wonderment in about 10 minutes. When I press ctrl- and
> mouse over language elements, my eclipse ruby cannot
> figure out where to go, often landing on a method with the
> same name but in the wrong module. And I have empathy for
> the ruby IDE, as I have the same trouble, it's all so
> vague and mysterious...and I get this Deja vu feeling I
> had 10 years ago working on a large perl project.
>
> If we're all going to start writing Scala I'm all for it,
> anything but PERL by another name.

I'm not a Ruby guy. I've done some Python, though. I wasn't really pointing out any specific languages. The point I was making is not that other languages are simpler. It's that other languages are more powerful. If Java is as complicated as one of these other languages, then I see little reason to continue using Java aside from it's broad support. At work, we still use Java 1.4 and I have doubts we will really adopt 1.5 here.

It's a shame because there is some good stuff in 1.5 and in 1.6.

Nick Nolan

Posts: 1
Nickname: notany
Registered: Jan, 2008

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 10:07 AM
Reply to this message Reply
I am in the fortunate position of being Common Lisp programmer. This gives me the knowledge that I know language that has the "Big ball of mud" characteristics. You add more mud into it and it still looks like ball of mud. You can thank the minimal syntax for that.

Feature junkies can add their own extensions to language using meta object protocol (MOP). Libraries like AspectL (adds aspect oriented programming) and ContextL (context oriented programming) are just start. And they work with the rest of the language.

Currently CL has all the features I need, and the new CL renaissance is bringing libraries from enthusiastic developers.

Gili T.

Posts: 6
Nickname: cowwoc
Registered: Jul, 2007

Re: Java: Evolutionary Dead End Posted: Jan 4, 2008 10:44 AM
Reply to this message Reply
I agree with Bruce: I value clarity over backwards compatibility. I believe it makes sense to break backwards compatibility when absolutely necessary (i.e. not for fun) every major release or two.

In my view, fixing Generics is by far the most necessary cleanup.

I have nothing against adding new features into Java, so long as they are well thought out and tried out (via prototypes) and have a good power-to-weight ratio as described by Joshua Bloch. Just my 2 cents :)

Flat View: This topic has 92 replies on 7 pages [ « | 1  2  3  4  5  6  7 | » ]
Topic: Java: Evolutionary Dead End Previous Topic   Next Topic Topic: Can iTunes Accomplish What Jini Couldn't?


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us