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


   

 
 
Download Current Issue
ISSUE 7/1/2009 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
Is the mystery Borland suitor Serena?
Borland software is considering an offer from another company after a preliminary deal with MicroFocus. Is Serena the new company?
06/30/2009 01:55 PM EST

Windows 7 - An eBayer's dream product?
Windows 7 pre-orders can make people money on eBay.
06/29/2009 03:48 PM EST

Know thine cloud provider
Cloud computing require companies to understand compliance and regulation. Third parties will play a big role in regulated industries.
06/29/2009 02:58 PM EST

 

Microsoft Worldwide Partner Conf.
7/13/2009 to 7/16/2009
New Orleans
Microsoft

OSCON (Open Source Convention)
7/20/2009 to 7/24/2009
San Jose
O'Reilly Media

XBRL Technology Workshop & Summit
7/28/2009 to 7/30/2009
Santa Clara
XBRL US

ACM SIGGRAPH
8/3/2009 to 8/7/2009
New Orleans
ACM SIGGRAPH

OpenSource World (formerly LinuxWorld)
8/12/2009 to 8/13/2009
San Francisco
IDG World Expo


 
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