No change, no change!
Seems that Bruce Eckel is unhappy over all the attention that Ruby (specifically, Ruby on Rails) is getting - so he wrote up a counter to Bruce Tate's "Beyond Java". I don't think he's unfair to Tate's book, although I must admit that I have more sympathy for Tate's argument. In any case, Eckel recycles the "Humane Interface" discussion from awhile back, and - like most of the Java enthusiasts - misses the point:
Martin's argument is that Java's List interface requires you to say aList.get(aList.size -1) to get the last element, and this seemed silly to him. Which it is, if you have unified all sequence containers (that is, list containers) into a single type, as Ruby and Python do. Java, however, follows the C++ STL approach of providing different types based on the efficiency of various operations. The Java libraries do not unify to a single list type because of efficiency issues, so you have to decide if you are going to be fetching the last element from a list a lot, and if you are you use a LinkedList, which does have a getLast() method -- a fact which was completely left out of Martin's original discussion, and the ensuing firefight (other than some ignored comments).
What he misses is the pragmatic approach that Ruby and Smalltalk take. Convenience protocol is no bad thing, and - given decent tools (like Smalltalk has), lots of methods in a class aren't a problem. At least in Smalltalk, most of the convenience protocol landed in the Collection classes based on many, many years of usage - and Ruby was, to a large extent, modeled on Smalltalk. The big problem in a language like Java is that you can't just add a new method to an existing class - instead, you get an explosion of "helper" classes wrapping them. I suppose that's a pragmatic approach given Java's design, but I wouldn't call it an instance of good design.
Eckel approaches all that with the thought that developers should know up front that they'll need a given method, and then pick the right class. Umm, yeah - I always have full information when I get started. I guess in his world, he never runs into that "oh, crap" moment when you realize that some object is missing protocol that would make life simpler. Elliotte Harold, who weighed in on this extensively, never really got that point either.
Anyway, David Heinemeier Hansson (the Rails guy) had some thoughts on Eckel's response to Tate:
I'm losing track of the ill-conceived comparisons, but I do know what's astoundingly clear: Bruce Eckel doesn't like Ruby, he doesn't like the attention its getting, and he doesn't like people such as Bruce Tate fueling that attention. No beef, that's cool. But why not just say it like that?
You could even have presented yourself as the polar opposite to the so-called hyper-enthusiasts: A hyper-detractor! The label comes complete with a cape, an evil smirk, and long tirades about how the other side is no match for your master plan.
David does get a bit too snarky over Eckel's changed opinion on Python - it is possible to change your mind over time. Writing extensively on the web simply makes it possible for people to find your old opinions more easily and imply it's some kind of hypocrisy.
Hat Tip to Tim Bray.

Comments
Point missed
[Mike Brazinski] December 21, 2005 8:28:11.000
The problem is the java.util.List interface, or more loosely, interfaces in general. The creator(s) of an interface need to make it both easy to use and easy to implement. These two contradictory goals make sure no one is happy. You want your interface to have a minimal number of methods so that implementors have an easy job and large number of methods to make users of it happy.
java.util.List is a perfect example. Do I really need to add getLast() to the interface when get(aList.size() - 1) does the job? Our team has been pondering practically the same problem on and off for the past month and we're still debating it. Creating a fat interface and throwing implementations like getLast() in an AbstractList might be a solution but that can introduce inheritence limitations.[] December 21, 2005 9:18:46.000
The argument that getLast() should not be on the List interface is nonsense. The argument that getLast belongs only on LinkedList but not on ArrayList is even more nonsense.
Both ArrayList and LinkedList can get the last element of the list in constant time. An ArrayList can just index the last element. A LinkedList has a pointer from the list itself to the last node. However, if my code receives a reference to a List object I don't know if it's an ArrayList or LinkedList. So how do I get the last element? I have to call list.get(list.size()-1). Unfortunately that only runs in constant time if I'm lucky enough to receive an ArrayList. If I get a LinkedList it runs in linear time. That's why humane interfaces are more helpful for the programmer, make code more readable *and* make code more efficient.
I normally agree with you re:Java, but you're wrong here
[Bill Mill] December 21, 2005 9:44:12.000
> What he misses is the pragmatic approach that Ruby and Smalltalk take.
> Convenience protocol is no bad thing, and - given decent tools (like
> Smalltalk has), lots of methods in a class aren't a problem.
Bruce doesn't seem to argue this point. He says:
and then goes on to explain that, *in Java*, the list.get idiom makes sense because you have to choose between several different containers, each implemented differently for performance reasons. He doesn't say that you don't ever need to change these containers, or that the Java way is good design, just that it makes sense in Java.
You go on to say:
> Eckel approaches all that with the thought that developers should know
> up front that they'll need a given method, and then pick the right class.
No he doesn't. He just says that, in Java, they *do* need to pick a container up front for performance reasons. Not that it's good, not that they'll never need to change it, just that they will need to.
Since Bruce spends the whole article practically tripping over himself to praise python, why do you mistake him for a Java zealot?
On hypocrasy
[David Heinemeier Hansson] December 22, 2005 1:40:48.351
The hypocrasy is not in Eckel's change of heart, but in his inability to see himself in Tate's argument. Eckel charges Tate with a quick dismissal of Python based on insufficient information. That's exactly what Eckel did to Ruby not too long ago. Yeah, I think that deserves calling him a hypocrite.