Interview with Joshua Bloch
Earlier, I’ve recommended the James Gosling interviews by Bill Venners. This morning, while taking my daughter for a stroll in no less than THREE different parks in my neighborhood, I read another interview of his, this time with Sun’s Joshua Bloch on the topic of API design. Very interesting to read.
Java has a bunch of weird things in it, like some of the API’s that are TOTALLY different than anything else in the JDK—<a href="http://java.sun.com/products/jdk/1.1/docs/api/java.io.StreamTokenizer.html">java.io.StreamTokenizer</a> is one of my favorites; to set it to parse numbers, you do st.parseNumbers();.
Then there’s the weird naming guidelines in their coding conventions which state that methods names “should be verbs”, period. Are equals, toString, keys, indexOf, and scheduledExecutionTime all examples of verbs? In the NeXT frameworks there was a very clear and intuitive naming scheme, which is something I miss in Java.
Anyway, the above interview mentioned such a weirdness regarding the <a href="http://java.sun.com/products/jdk/1.1/docs/api/java.lang.Cloneable.html">Clonable</a> interface and the <a href="http://java.sun.com/products/jdk/1.1/docs/api/java.lang.Object.html#clone()">clone</a> method, which is designed in such a way that it is essentially useless. Besides that, it contains discussions on design that were interesting to read.