Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Java for C/C++ programmers
Daconta M., John Wiley & Sons, Inc., New York, NY, 1996. Type: Book (9780471153245)
Date Reviewed: Apr 1 1997
Comparative Review

By now, nearly everyone in the computing field knows what Java is: an object-oriented, Internet-aware language with the potential to revolutionize programming. After Java’s formal introduction in the spring of 1995, there was only a short delay before books on Java began to appear. The first wave of books, published in late 1995, were superficial; they explained what Java was, presented a number of applets, and spent a lot of time discussing Sun’s HotJava browser.

The books discussed in this review are part of the second wave--the first serious Java books. They are much longer and more detailed than their predecessors. Their focus is on the Java programming language itself, and most assume that the reader has some previous programming experience.

All the books under review are trade books rather than textbooks. As a result, they share characteristics common to many trade books. None of the books has exercises, nor does any provide a bibliography or references for further reading. As a result of the rush to get these books into print, attention to detail is often lacking. Typographical and minor technical errors are common. None of the books in this group has an excellent index, and in several the index is noticeably substandard.

Barlett, Leslie, and Simkin

In this collaborative effort, each of the 22 chapters is written by one of the three authors. Chapters 1 and 2 discuss Java in general terms and describe what applets are. Chapters 3 and 4 cover most of the basics of Java. Chapter 5 describes exceptions in detail, while chapter 6 explains object-oriented programming. Chapter 7 discusses strings. Chapter 8 covers input and output. Chapter 9 describes Java’s data structures. Chapter 10 covers the Date and Time classes. Chapter 11 develops a sample application. Chapter 12 discusses applets. Chapters 13 through 19 discuss GUI programming, graphics, images, animation, and sound. Chapters 20 through 22 cover threads, networking, and interfacing with C.

At 820 pages, this is by far the longest book in the group, allowing topics to be developed in more depth. Its coverage of Java’s Abstract Window Toolkit (AWT) is the best of any of the books. Moreover, this book has the greatest variety of examples, including many medium-sized and large programs. Unfortunately, the authors often use the extra space to ramble and include irrelevant material. Page 441, for example, is occupied almost entirely by a brief email message, complete with all the header information.

The book’s writing style is best described as verbose and chatty. The forced attempts at humor are often annoying. (Chapter 20, for example, is titled “Nice Threads, Javaman!”) The bad jokes (“Q: What shape is made by a parrot when it is squashed under the front wheel of a car? A: A poly-gone.”) tend to distract rather than amuse.

The index is so poorly done that it deserves special mention. For one thing, it is “hierarchical”; as a result, the entry for “buttons” does not appear under the B’s. Instead, the reader must know enough about Java to guess that “buttons” is a subentry under “components.” Not only does this practice make the index hard to use, but it leads to a huge number of sub-subentries. To make matters worse, the index is full of irrelevant trivia: there are entries for “The Fly,” “Disneyland,” and “Dutch National Public Radio,” to name just a few.

Although the book is attractively designed, some programs are afflicted with a formatting glitch that removes indentation from random lines.

Overall, this is a good book. It would have been even better if it had been tightly written and edited carefully, and if it had a decent index.

Cornell and Horstmann

This book is one of several in SunSoft Press’s Java series. It is aimed at a more advanced audience than most of the other books under review--in the words of the cover blurb, it provides “hard core Java for serious programmers.” Readers are assumed to know C, C++, or Visual Basic. In fact, this is the only book in the group to provide comparisons of Java with Visual Basic (in addition to the more common C++ comparisons).

Table 1: Descriptive Data
Barlett, Leslie, and SimkinCornell and HorstmannDacontaFlanaganLemay and PerkinsNaughton
Number of pages820622443438527424
Density (maximum number of words per page)525575525775625600
Number of chapters2213892120
Number of appendices3332441
GlossaryNoNoNoYesNoNo
Access to program codeCD-ROM includedCD-ROM includedDisk includedVia InternetCD-ROM includedNone
PurposeTutorialTutorialTutorialReference, tutorialTutorialTutorial
Background assumedLittle or no programming experienceC, C++, or Visual Basic experienceC or C++ experienceC or C++ experienceSome programming experienceLittle or no programming experience

The book is divided into 13 chapters: “An Introduction to Java,” “The Java Programming Environment,” “Fundamental Programming Structures in Java,” “Objects and Classes,” “Going Further with OOP: Inheritance,” “Graphics Programming with AWT,” “Designing User Interfaces with AWT,” “Applets,” “Data Structures,” “Exceptions and Debugging,” “Input and Output,” “Multithreading,” and “Networking.” Its coverage of advanced topics is uniformly good; the descriptions of data structures, exceptions, threads, and streams are the best of any book in this group.

Applications are stressed over applets. Applets are not even covered in any detail until halfway through the book, and the vast majority of sample programs are applications. The large assortment of programs--which tend to be medium-sized rather than large--includes many that are nontrivial. Even the short programs are often interesting.

In contrast to the levity of Barlett, Leslie, and Simkin, this book has a more serious tone. It manages to be authoritative without being stuffy or boring.

Although this book is not appropriate for a programming novice, just about anyone with some experience would benefit from reading it. It is thorough and detailed, yet easy to read.

Daconta

As its title implies, this book teaches Java primarily by comparison with C and C++. There are only eight chapters: “An Introduction to Java,” “Comparing Java to ANSI C,” “Comparing Java to C++,” “The Java Standard Library,” “Language Features Not in C or C++,” “Abstract Window Toolkit,” “HotJava, Applets, and JavaScript,” and “Comparing JavaScript to Java.” The final two chapters are notable; none of the other books under review discusses JavaScript, a scripting language that is only superficially related to Java.

Although the chapters comparing Java to C and C++ are helpful for readers who already know those languages, they could be much better. The author wastes too much space bashing C and C++ rather than explaining Java. Moreover, he feels compelled to walk the reader through the two languages--and their standard libraries--in more detail than is necessary. For example, he lists all the required signals in C, an irrelevant detail.

This book is notable for its brevity. Although it is not the shortest book among those under review, it is tied with Barlett, Leslie, and Simkin for the lowest density (maximum number of words per page). Moreover, half of the book consists of program listings, with some as long as 14 pages. Portions of the book are little more than annotated programs. As a result, this is the shallowest of the books in this group. The good news is that the book contains plenty of sample applications, including many that are medium to large in size. (Applets are slighted, however; there are only two in the entire book.)

The book’s organization is suspect. For example, chapter 4 (“The Java Standard Library”) has just two sections, “Overview of the Java Standard Library” (6 pages) and “Detailed Description of the Java Standard Library” (92 pages). This chapter should have been divided into more sections or else split into several chapters.

The poor organization of this book is reflected in its overly sparse table of contents, which is only 2 pages long. (In other books, the table of contents is 5 to 18 pages long.) The table of contents lacks entries for a number of key Java concepts, including input/output, networking, components, events, graphics, and images.

Table 2: Subjective Evaluation
Barlett, Leslie, and SimkinCornell and HorstmannDacontaFlanaganLemay and PerkinsNaughton
Number of complete programsHighHighHighLowMediumHigh
Number of nontrivial programsHighHighHighMediumLowLow
Program emphasis (applets vs. applications)ApplicationsApplicationsApplicationsEvenly DividedEvenly DividedApplications
Quality of indexPoorGoodFairGoodFairGood

The book’s prose style is a bit too breezy. (“Boy, all this slapping around of pointers, which I find to be crucial to complete the training of any programmer.”) The “gee whiz” tone can be cloying. (“These are truly exciting times!…In Java and HotJava we have tools that make programming fun again! That is truly exciting because there is nothing more powerful than a programmer having fun!”)

One last quibble: when Java code is mixed with ordinary text, it is not distinguished from the text in any way (by using a different typeface, for example). As a result, some sentences have to be read more than once to determine their meaning.

Overall, the book gives the impression of having been quickly thrown together, padded with program code and unnecessary details about C and C++, and formatted for maximum length.

Flanagan

Unlike the other books, this one purports to be a “quick reference” rather than a tutorial. Still, it contains enough tutorial material to be included in this group.

The chapters and appendices (collectively referred to as “sections”) are divided into five parts. Part 1 (“Introducing Java”) compares Java with C and explains classes and objects. Part 2 (“Programming with the Java API”) covers applets, GUI programming, input and output, networking, image processing, and threads. The remaining parts contain reference material. Part 3 (“Java Language Reference”) covers Java syntax, events, fonts, colors, cursors, system properties, applet parameters, applet security, HTML and HTTP syntax, Unicode, and JDK development tools. Part 4 (“API Quick Reference”) lists the contents of the packages in the Java API. Part 5 (“API Cross References”) contains cross-references that make it possible to determine in which package a particular class is defined, which class defines a particular method, which classes extend a particular class, which classes implement a particular interface, which methods return instances of a particular class, which methods take arguments of a particular class, and which methods throw a particular exception.

Parts 1 and 2 constitute a highly condensed, 171-page tutorial on Java, aimed at experienced C and C++ programmers. Part 1, which covers language basics, suffers from disorganization and excessive condensation. Part 2, which describes advanced features, is better organized, but consists largely of program code accompanied by sparse commentary. The author makes little attempt to explain general principles; instead, he expects the reader to infer these by studying the code.

The remainder of the book is reference material. Here is where the book’s primary value lies. Part 4 lists every class in the Java API, with methods and variables shown. Sadly, there is little description of what the methods do. (Granted, describing the methods fully would have added hundreds of pages to the book.) The cross-reference information in Part 5 is one of the book’s most useful features.

The best things about this book are its low price, extensive reference material, and realistic programs. It presents a detailed but highly condensed description of Java. Experienced C and C++ programmers may prefer its no-nonsense manner, but less experienced programmers will find its terminology daunting and its pace too fast.

Lemay and Perkins

This book, a huge best-seller, was the first to cover Java in any depth. Although many other Java books are now available, this one remains among the leaders.

As the title implies, the book is divided into 21 chapters (“days”), each written by one of the authors. The first seven chapters cover basic language features, including arrays and classes. Chapter 8 discusses applets. Chapters 9 through 14 describe Java’s support for graphics, animation, images, sound, and GUI programming. The next 6 chapters cover access control, packages and interfaces, exceptions, threads, streams, and native methods. The final chapter discusses implementation details, including the Java virtual machine, garbage collection, and security.

It is not hard to see why the book has sold well. The writing is clear and easy to understand. The tone is informal without being silly. There are plenty of examples. The pacing is good, allowing the reader to progress at a slow but steady rate. Q&A sections at the end of each chapter address frequently asked questions about Java.

Still, the intended audience for this book is not entirely clear. On the one hand, the development of basic language features seems aimed at readers without significant programming experience. On the other hand, there are relatively few complete programs in the book, and most of these are short and artificial; beginners would be better served by having at least a few large programs to study. Moreover, the book delves into advanced topics (native methods and implementation details) that are likely to be of little interest to inexperienced programmers.

Overall, this book is a good choice for someone with limited programming experience. Its friendly manner and many short examples should make learning Java relatively painless. More experienced programmers may find it too slow and lacking in depth.

Table 3: Topic Coverage
Barlett, Leslie, and SimkinCornell and HorstmannDacontaFlanaganLemay and PerkinsNaughton
AppletsVery goodExcellentGoodGoodGoodFair
Abstract Window ToolkitExcellentGoodFairMinimalGoodFair
Data structuresVery goodExcellentMinimalMinimalMinimalMinimal
ExceptionsGoodVery goodFairFairFairFair
ThreadsGoodVery goodFairFairFairFair
StreamsGoodVery goodMinimalFairGoodFair
NetworkingVery goodVery goodMinimalFairMinimalFair
Native methodsGoodNoneNoneNoneFairNone
Java internalsNoneNoneNoneNoneFairNone
JavaScriptNoneNoneFairNoneNoneNone

Naughton

Alone among those under review, this book is written by someone who participated in the creation of Java at Sun Microsystems. (Naughton, in fact, founded the team that developed Java.) References to the history of Java are scattered throughout the book; an epilogue presents a detailed account of Java’s early years.

The book’s 20 chapters are divided into three sections. The first section, “Java Language,” covers basic language features, including classes, packages, and interfaces. The second, “Java Classes,” focuses on strings, exceptions, threads, utility classes, input/output, networking, applets, the AWT, and imaging. Each of the three chapters in the final section, “Java Applets,” is devoted to developing a nontrivial applet.

The book assumes little previous programming experience. It carefully covers all Java features, including the ones inherited from C. The first 17 chapters are nearly identical in their approach: language features and library classes are explained one by one and illustrated with short programs. The reader who wants to see a “real” program, not just an artificial example, must wait until the final 3 chapters. Since it devotes so much space to elementary topics, the book tends to give short shrift to the more advanced aspects of Java.

The book is notable for its insider’s look at Java and the interesting applets it presents in the final three chapters. The rest of the book is passable, but the lack of realistic examples hurts it in comparison to the other books under review.

Comparison

Cornell and Horstmann is the best choice for experienced programmers. It is unmatched for technical depth, yet remains highly readable. Less experienced programmers who want a more leisurely introduction to Java will prefer the relaxed pace of Lemay and Perkins. Barlett, Leslie, and Simkin is also a good book. It has a poor index, however, and some readers may find its flippant tone to be distracting. Flanagan is a valuable reference at a bargain price, but as a tutorial it is suitable only for highly experienced programmers who want a quick and dirty introduction to Java. Naughton provides a unique perspective on Java, but lacks depth and does not have enough nontrivial examples.  Daconta,  on the other hand, is a worthwhile source of lengthy examples, but is even more shallow.

The Java book scene is likely to change dramatically in the near future. By the time this review is published, scores of new books will have appeared. Still, many of the books in this review are likely to survive, albeit in new editions.

Reviewer:  K. N. King Review #: CR120265 (9704-0245)
Comparative Review
This review compares the following items:
  • Java for C/C++ programmers:
  • Java programming explorer:
  • The Java handbook:
  • Core Java:
  • Teach yourself Java in 21 days:
  • Bookmark and Share
     
    Java (D.3.2 ... )
     
     
    Design (D.2.10 )
     
     
    Language Constructs and Features (D.3.3 )
     
     
    User Interfaces (H.5.2 )
     
    Would you recommend this review?
    yes
    no
    Other reviews under "Java": Date
    Java in a nutshell
    Flanagan D. (ed), O’Reilly & Associates, Inc., Sebastopol, CA, 1996. Type: Book (9781565921832)
    Jun 1 1997
    On to Java
    Winston P., Narasimhan S., Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, 1996. Type: Book (9780201498264)
    Jun 1 1997
    Learn Java on the Macintosh
    Boone B., Mark D., Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, 1996. Type: Book (9780201191578)
    Jul 1 1997
    more...

    E-Mail This Printer-Friendly
    Send Your Comments
    Contact Us
    Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
    Terms of Use
    | Privacy Policy