Book review Elliote Rusty Harold, acclaimed Java and XML author, recently described Java as the lingua franca of the programming world. According to Harold he can write basic Java and have it understood by non-Java programmers more often than not.
It’s the language of choice for computer science education and is so ubiquitous in development that many programmers can follow Java code even if they’ve never had to write a line of Java code for themselves. However, for those non-Java developers who need a bit more than pidgin Java, help is at hand in the form of the Java Phrasebook by Timothy Fisher.
As with a real phrasebook (you know, for languages that people speak rather than key into an editor), the Java phrasebook is more than a simple dictionary or lexicon. It operates at the level of complete phrases and sentences, providing the reader with the tools to accomplish specific tasks. Where a French phrasebook might help in ordering a meal, booking a taxi or doing some shopping, this Java phrasebook helps in opening a file, navigating a directory tree or sending and receiving email.
In all there are around a hundred different phrases included in the book, organised across 17 chapters. The book opens with the basics of compiling and running a Java program and then moves into progressively more complex tasks – from regular expressions to network programming to database connectivity to XML, threading, reflection and finishing with packaging applications as jar files. It’s a fairly wide scope that starts simple and becomes more complicated and ambitious as the book progresses.
Each task is described in some detail with solutions presented in Java code, using a combination of snippets and complete classes. The discussion is as important as the code and it’s what stops the book being a basic cookbook of predefined blocks of code. While it won’t teach the reader to program in Java, the book does more than simply hand out a list of answers (though some readers can certainly get away with using it that way if required).
Obviously the book is most useful for those with only a passing knowledge of Java. It’s unlikely that a practising Java developer is going to find much that is new here, but then that isn’t the intended audience. However, for those who do fit the intended readership there are a couple of things to be wary of. Firstly in the chapter on the collection classes the author has chosen to not use generics. While this makes the code simpler to read it does mean that the code will throw up compiler warnings with the latest versions of Java. It also means that anyone using this part of the book when looking at recent Java code in the ‘wild’ will be mystified by the use of angle brackets and generic type information.
Secondly the book delves into some complex areas. Reflection and threading, for example, are complicated topics that should be handled with care. They are not the kinds of areas to be getting into without some solid Java skills to call on, trying to learn them from a phrasebook is probably a bit on the ambitious side.
Those caveats aside, this book provides a fast guide to Java for those with skills that are rusty or have little experience with the language.
The Java Phrasebook
Verdict: A useful resource for those in need of the occasional bit of Java code.
Author: Timothy Fisher
Publisher: SAMS Publishing
List Price: £11.99
Current Reg price: £7.91 inc. VAT (discount 34%)
Buy this book at Register Books at Reg Developer's special discounted price (subject to change)!