Most Read Latest News Blog Resources

Learning Java: What a Choice!




January 1, 2007 — 
In his remarkable little book “The Paradox of Choice,” Barry Schwartz discusses the downside of having too many choices at the store: too much time deciding between items that are different in minor ways, uncertainty over whether you’ve bought the best item, and because of these factors, an inability to completely enjoy your purchase. For some items, like crackers or jeans, this dilemma is not terribly important, because the cost of the item is low enough. However, when it comes to items that require a time investment—such as books—you do want to make the choice correctly the first time.

One programming area with a surfeit of choices is Java programming textbooks. There are at least several solid options, beyond the hopelessly optimistic popular titles, such as “Teach Yourself Java in 24 Hours” and “Java in 21 Days.” I want to focus on the best books, which all presume you already know how to program. As you’ll see, most of these books have a lot in common, and several look enough alike that your choice could easily be based on a coin flip rather than a long, deliberate process.

The most famous Java textbook is Bruce Eckel’s magnum opus, “Thinking in Java” 4th Edition (Prentice Hall PTR). I do mean magnum: It tips in at 1,482 pages. This book was made famous by Eckel’s decision to make earlier editions available free online. This edition is not downloadable, but the previous ones (which cover Java through 1.4) are still at mindview.net/Books.

Eckel’s text has two distinguishing traits: First, he drills deeply into many of the implementation aspects of the language, so that you truly understand how your Java code runs. The other trait is his deep understanding of object orientation. He frequently relates features of Java to prototypical OO designs and to other OO languages, such as C++.

Despite its length, the book isn’t complete. For example, Eckel never discusses resource bundles, which are a wonderful feature of Java. Eckel’s code takes some getting used to. He uses a large font, so his style is cramped trying to get everything to fit in one page. My only serious gripe is the heft of the book. At nearly 5 pounds, it’s hard to hold and carry. To evaluate this text online, download the previous version and you’ll get a good idea of how thoughtfully this book presents Java.

In Eckel’s own words, Cay S. Horstmann and Gary Cornell’s “Core Java” vols. 1 and 2 (Prentice Hall PTR) “cast a bigger net” than his book. They cover resource bundles, for example, and tip in at 2,000 pages total. At this size, you don’t expect to ever read them, but instead to read the basics in their entirety and then jump to individual chapters of interest. Each book is smaller than Eckel’s and the source code is formatted more naturally. Choosing between these and Eckel’s work is a matter of taste.

A smaller version of these two options is Patrick Niemeyer and Jonathan Knudsen’s “Learning Java” (O’Reilly). It has far less code and the explanations miss the depth found in “Core Java” and Eckel’s book. Although it’s well written, I am not sure to whom I would recommend in preference to the other titles discussed here.

The next two books cover Java qua language and touch only on the key API sets, rather than diving into the near-endless ocean of functions. “Head First Java,” by Kathy Sierra and Bert Bates (O’Reilly), is a fun book that relies on cartoons, funny commentary and exercises like “Pretend You’re the Compiler.” Its light nature should not belie its ability to communicate language concepts very effectively. I recommend it especially to readers who want a gentle introduction to Java. Its one obvious shortcoming is the difficulty of using it later as a reference, as the factual nuggets appear in a stream of games, puzzles and irreverent comments. Otherwise, it’s a fun way to learn.

Finally, for those who want something more serious but don’t require the omnibus tomes, there’s “The Java Tutorial” 4th Edition, by Zakhour et al. (Addison-Wesley Professional). In 600 pages, it presents all of the language proper, with well-chosen code examples, plus the basics of the major API sets. It’s put out by the same team that developed Sun’s outstanding online Java tutorials (java.sun.com/docs/books/tutorial), which might be the best tutorials ever developed for any language. Get this book to start with, unless one of the others has a particular feature you feel is critical. Either way, you’ll be treated well.

Andrew Binstock is the principal analyst at Pacific Data Works. Read his blog at binstock.blogspot.com.


Share this link: http://www.sdtimes.com/link/29933
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading



 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 3/15/2010 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
blogs tab
Google Code turns 5
Google Code Turns 5, and adds a Paxos Algorithm to make the system more stable and reliable.
03/17/2010 11:16 AM EST

Test your Visual Studio 2010 know-how
Microsoft is offering free beta certification exams for Visual Studio 2010.
03/17/2010 11:08 AM EST

Microsoft lifts the hood on IE9
Microsoft is previewing IE9.
03/16/2010 01:10 PM EST

 

Events calendar tab
3/22/2010 to 3/25/2010
Santa Clara, Calif.
The Eclipse Foundation

4/12/2010 to 4/14/2010
Las Vegas
Penton Media

4/12/2010 to 4/15/2010
Santa Clara, Calif.
O'Reilly Media

4/19/2010
New York City
Flagg Management

4/25/2010 to 4/28/2010
Overland Park, Kans.
IIUG