Web services test code generator
Klaus Berg has recently released a test-code generator for JUnit-based Web service clients. If you're developing Web services using Axis2 and XMLBeans this wizard could turn your JUnit test client coding into a powerful code generation process. It also has uses for those using GUI-based testing tools like soapUI.

Newsletter sign-up

Sign up for our technology specific newsletters.

Enterprise Java
View all newsletters

Email Address:

In search of the best Java book for beginners

A comparative review of 7 intro-programming language books

Until, say, 1996, I wouldn't have blamed any teacher still using Pascal as the main teaching prop in an introductory computer science curriculum (often code-named CS 101 or CS1). The obvious alternative (C++) was quite rightly considered by many teachers to be a pedagogical minefield. Today, however, there is no excuse: If you're not using Java to give your students their first taste of programming, then you are leaving the door wide open to be rightfully accused of not giving your students the best possible computer science education.

In the past year, a small minority of teachers found themselves unsatisfied by "just" pushing the teaching envelope in their respective classrooms (that is, by ditching Pascal and the legacy of its generation's procedural programming style, and adopting Java and its modern object-oriented programming style). These pioneering few went a step further by writing teaching texts for complete beginners, betting the whole shop on Java.

This month's book review takes a look at seven books that share the goal of teaching complete non-programmers how to program, and to do so with Java. (Notice that these books are quite distinct from those books designed to teach Java to programmers who've never used Java before. These books are for students who've never programmed with any computer language before.)

The titles reviewed are:



Below is a comparison table to provide you with a bird's-eye view of each title's main characteristics.

Java For Students Java Gently Java -- An Object First Approach Introduction to Programming Using Java -- An Object- Oriented Approach Object-
Oriented Programming in Java
Java How To Program Computing Concepts with Java Essentials
Price (U.S.$) 8.00 6.95 4.00 7.95 9.99 8.00 7.95
Pages, Chapters (Appendices) 586, 29 (8) 508, 15 (2) 394, 17 (3) 783, 14 (4) 953, 16 (2) 1063, 18 (6) 624, 14 (3)
Authors 2 1 1 2 2 2 1
Glossary Poor No Yes Yes No No Excellent
Index Poor Poor V. Poor Yes Yes V. Good Yes
CD-ROM No No No No Yes No * Yes **
Listings density (lines/page) 48 56 53 48 58 50 50
Object-oriented early? No Yes Yes Yes Yes No No
Applets(A) or applications(B)? A B B A A&B A&B A&B
Graphics early? Yes No No No No No Yes
Support classes? No Yes No No No No Yes
Keywords highlighted? No No Yes No No No No
Suitable for hobbyist? No No No No Yes No No
Overall score 6/10 4/10 2/10 7/10 8/10 6/10 8/10
* The book doesn't come with a CD-ROM, but Prentice Hall sells a different product that combines the book with an interactive CD-ROM. See the book's review below for details. ** Strictly speaking yes, but the CD-ROM content is unrelated to the book's content!

In the absence of tools to calculate the true cost-per-bit equivalent of a book, the "Listings density" row gives you an idea of how dense or "aerated" the program listings are. Low lines and/or page values usually mean unreadable listings and a high page-fill factor, so the higher this value, the better.

The "Object-oriented early?" row indicates how modern the text is. Modern texts tackle object-orientation first, while conservative texts start by exploring procedural programming concepts. Although conservative texts need not be problematic, per se, you are advised to consider first texts that submerge you in the modern computer-science world view of object-oriented software.

The "Applets or applications?" row indicates which type of Java programs the authors primarily use. Java applets tend to be regarded as more fun (or "cool") by new students, so there's a lot to be said for texts that use lots of applets, especially early on.

The "Graphics early?" row indicates whether the author(s) let the student use graphics programming early on. Letting students see their programs "live" by way of dynamic, graphical output (instead of comparatively boring, plain text output) is a proven approach to get students interested in a programming course.

The "Support classes?" row indicates whether the authors attempt to shield students from Java's few student-unfriendly facets, by interposing some support classes (a text-formatting class, for example) between example programs and the raw Java classes.

The "Keywords highlighted?" row indicates whether the text enhances its program listings by highlighting keywords (and maybe other grammatical elements, such as program comments). Since even software veterans appreciate such highlighting (on the screen, as well as on paper), you can bet that such highlighting could significantly help students new to programming comprehend their first batch of examples.

The "Suitable for hobbyist?" row indicates whether the text takes the reader through all the necessary steps to fully install and configure a working Java software development environment. Most texts leave significant gaps in this area, presumably relying on a real-life teacher to be at hand to help with such initial tasks.

Java For Students by Bell & Parr (Prentice Hall)

Java For Students immediately distinguishes itself from its competition by using applets from the beginning (p. 14). Its "Hello World" program (the de facto program that most teachers use to introduce programming) is therefore the following seven-liner:

 
import java.awt.*; import java.applet.Applet;  public class Greeting extends Applet {     public void paint (Graphics g) {  g.drawString ("Hello"), 50, 50);     } } 


This applet-centric approach means the authors incur the cost of having to introduce a modicum of HTML to create a Web page for this applet, but the long-term return on this investment is considerable: From p. 22 onward (Chapter 3, "Introductory Graphics"), the authors are free to employ the pedagogically more productive use of graphics programming as a means to bring software to life. Chapter 8, "Repetition -- while, for and do," for example, relies on rendering graphical output to illustrate the use of program loops.

Resources
  • Academic institutions teaching JavaA slightly out-of-date list maintained by Sun http://www.sun.com/products-n-solutions/edu/pandp/javaschools.html Should Java be taught in first year Computer Science? A very interesting site for teachers. It contains several links to other sites of similar value. http://www.cs.uwa.edu.au/~chris/java-in-cs1/
  • Java in the Computing Curriculum Conference (JICC3). South Bank UniversityLondon on Monday the 25th January 1999. http://www.scism.sbu.ac.uk/jfl/jicc3/
  • Java -- An Object First Approach http://www.scism.sbu.ac.uk/jfl/Chapter1/chap1.html
  • The standard, free, platform-neutral documentation to the Java classes. http://java.sun.com:80/products/jdk/1.2/docs/api/index.html