Electronic Review of Computer Books

[ ERCB Home | New | Feature | Brief | DDJ | Letters | Links ]

[an error occurred while processing this directive]

Vital Statistics

Title

Python Programming with the Java Class Libraries

Author

Richard Hightower

Publisher

Addison-Wesley Publishing
http://www.awl.com/

Copyright

2002

ISBN

ISBN 0-201-61616-5

Pages

640

Price

$34.99


Jython Programming

I was ambitious -- have you known
The passion, father?

-- Edgar Allen Poe, "Tamerlane" (1827)

Python Programming with the Java Class Libraries, by Richard Hightower, is really about Jython (formerly JPython), which is an interpreter of the Python language coded as a Java class library. This means the Java-linked Python can optionally be used as an interpretive shell for Java, calling on every aspect of Java including Swing and J2EE. The fundamental intent of the book is to provide a tutorial for a platform-independent GUI-enabled interpretive language to be used after the fashion of the previous decade's Tcl/Tk, albeit vastly more powerful due to its entry into the rich Java environment.

The actual outcome of the author's labor is a book possessing good technical content, but marred by over-ambition, rife with partially digested information, written in a sententious and tendentious style.

Yes, "ambitious" is the keyword here. Though programmers believe in modularity at the code level, the faith isn't always kept when writing programming books. Python Programming with the Java Class Libraries attempts to teach you:

and other incidentals. Well, it's nice to have such a self-contained book, but how long did it take to write, how long is it going to take you to plow through all this material, and how soon is the reader going to be productive, especially if forced to browse selectively rather than reading through sequentially? Most of the subjects are covered more fully and more ably by other books. Observations that Hightower makes on certain topics were better left unsaid; for example, some inexpert and misleading comments regarding Unicode. Only in the twin realms of pure Python and Jython integration with Java is Hightower playing a home game, and that he handles with credit to himself and his publisher. I would have been happy to see a volume half the size (and price) in which the author limited himself to his core competency, leaving the rest to other books on the reader's shelf.

When Hightower goes on for two whole pages about slice notation (Python having come up with Yet Another Terminology for 0-based start-position-to-one-past-end array indexing) and still manages in the summary sidebar to sum up incorrectly:

The first character is assigned the index 0; the second character, the index 1…the range of the slice is up to but not including the second index. Thus a slice of [2:5] actually means the second through the fourth characters in string…

you have to wonder if even he can read his own work. Because that's the problem: The jumble, the welter of information Hightower wants to convey, all delivered in a colloquial tone that suggests he gives a great workshop. The style of communication that works in a seminar -- the constant forward referencing, the brushing aside of complexity with assurances that all will become clear by the third session-all that doesn't work as well in print.

If you're an experienced C++ programmer you can skip to Chapter 8, although you might want to skim Chapters 2 through 7 and use them as a reference. Visual Basic programmers can skip to Chapter 8 as well, with detours to Chapter 6 (on object-oriented programming) and 7 (on exception handling) and a skim of Chapters 2 through 5. Novice Java programmers with no C experience should concentrate on the last half of Chapter 3 (on string formatting) and the last half of Chapter 6 (on dynamic polymorphism and operator overloading) and skim Chapters 2 through 5…

Either Hightower has never read Dijkstra's "GOTO Statement Considered Harmful" or he doesn't believe it applies to technical writing. Besides, the implication is that there is a clever plan in the presentation, whereas in reality it's a core dump. There is meat in the core; don't doubt it. The knowledgeable programmer reading very selectively and dismissing the unsupported assertions and '80s-style language war fatuities such as:

…What does it all mean? Basically that Python is the best scripting language for the JVM. Here's why: ...

Ease of use. Python was designed to be easy for beginners. In Virginia, high school students are taught how to program in it.

Embeddability. On a scale from 1 to 10, Python scores 10 for embeddability.

and true-but-useless factoids such as:

InstantDB is a lightweight database that supports only a subset of the SQL syntax. Microsoft Access supports only a subset as well, but a larger one. The real problem is that the two databases don't always support the same subset.

can derive from this book the essentials of Python and the Jython model of scripting Java. But the author could have made it easier for readers by trimming the sails of his ambition, paring the presentation, and drying out the dripping prose.

-- Jack J. Woehr (http://www.softwoehr.com)

From Byte On-Line, November 11, 2002


Copyright © 2003 Electronic Review of Computer Books
Created 1/4/2003 / Last modified 1/4/2003 / webmaster@ercb.com