Java News from Wednesday, December 7, 2005

Yesterday's response to Martin Fowler touched a few nerves, but I'm holding my ground. Java's List class is demonstrably superior to Ruby's Array class, and the difference has nothing to do with the difference between the languages. There's no syntax-based reason Java's class couldn't have the extra methods Ruby's does or Ruby's couldn't eliminate the extra methods it does have. The difference is between the classes, not the languages in which they're written. To explain, let me borrow an example from Steve Jobs. Which of these three remotes would you rather use?

Apple remote vs. Microsoft remote

More buttons/methods does not make an object more powerful or more humane, quite the opposite in fact. Simplicity is a virtue. Smaller is better. Do you want to go all the way down to the absolutle theoretical minimum? For a list class that's probably about four public methods (new, insert, delete, get). Probably not. That's too few, but 78 is way too many. 10-12 is ideal purely from human-interface concerns. (I'd say 7-8 except I don't think most classes can really get that small. Maybe it is 7-8 if we count all overloaded variants as a single method though.) 25-30 is sort of the outside maximum: roughly the most signatures you can fit on a single piece of paper so that the programmer can see the whole class at once without scrolling their eyes. If that still doesn't convince you, tomorrow I'll take another look at the Array class that started this whole brouhaha and show exactly how pointless most of those 78 methods really are.

The Jakarta Apache Project has released version 5.5.14 of the Tomcat open source servlet container and official reference implementation of the Java Servlet API 2.4 and Java Server Pages (JSP) 2.0. This release "is an update of the APR optional dependency to version 1.1.1, and related configuration changes for the APR connector and installer. There are a few additional bugs fixed, as detailed in the change log." "Tomcat 5.5 is designed to run on J2SE 5.0 and later, and requires configuration to run on J2SE 1.4....In addition, Tomcat 5.5 uses the Eclipse JDT Java compiler for compiling JSP pages. This means you no longer need to have the complete Java Development Kit (JDK) to run Tomcat, but a Java Runtime Environment (JRE) is sufficient. The Eclipse JDT Java compiler is bundled with the binary Tomcat distributions. Tomcat can also be configured to use the compiler from the JDK to compile JSPs, or any other Java compiler supported by Apache Ant."