`Java Gently' (2nd ed.) by Judy Bishop

By Kevin Boone, PhD
Technical director, Web-Tomorrow

Overall impressions

In the light of what I shall say later, I should point out that Java Gently (2nd ed.) is a very good book. I have little hesitation in recommending it in my classes, and feedback from novice Java programmers has been, on the whole, very positive. It is well written -- informal without being patronizing -- and generally logical in its approach.
          Despite what many textbook authors claim, Java is not a particularly accessible language. It may be easier to learn than C++, but that isn't saying much. If this weren't true, there would only be a few Java textbooks on the market. As it happens there are hundreds of Java textbooks.

Strengths

  • The balance between applet and application programming is about right, as is the balance between `serious' programming applications and `frivolous' ones. This is a balance that it is very difficult to get right. On the one hand the use of Java as a tool to enhance Web sites has an immediate appeal, but tends to give the misleading impression that the language is constrained to these activities. On the other, an over-attention to serious programming topics (data structures, calculations, database management) can overwhelm and bore novices. In my opinion Java Gently has about the right amount of each kind of material.
  • The strong focus on Java as an object-oriented system is very much to my taste, and making explicit the correspondence between the principles of object-oriented design and the principles of programming seems very sensible.
  • The amount of subject coverage seems about right for a first course, or perhaps a little too much. The justification for including topics like Remote Method Invocation and JDBC is that ``students stumble upon them anyway''. If only! In practice these topics are covered with such little detail that they neither add nor detract from the overall impression of the book; for my part I would not wish to see these topics expanded in an introductory book (nor Swing, reflection, JavaBeans, security, and the rest of the Java extensions for that matter). Java Gently seems to contain almost the minimum coverage required for a person who has mastered it to say `I can write Java programs'. This is exactly what is required in a first course textbook.
  • The presentational style is excellent, with clear diagrams, nicely formatted text, and numerous stylistic devices for drawing attention to key points.
  • Although many Java textbooks claim to be suitable for people with no technical computing experience, Java Gently is the closest that a book I have seen has come to living up to that claim.
  • There are many program examples, covering a wide range of applications. Even the simplest examples have some usefulness.
  • Each chapter is followed by a good number of exercises, of varying complexity.

Weaknesses

  • The main weakness, as I see it, is this. Java is a rapidly changing subject, and it is almost impossible for a textbook to be really up to date. Java Gently suffers from this problem as much as any. Particular problems in this regard include the following.
    • If class diagrams are to be used, and they should, then the notation should follow the UML standard. The author claims that the notation used in Java Gently conforms to Rumbaugh's OMT scheme, but I'm not sure if this is strictly true. Rather it is a hybrid notation scheme that the author has found useful. So far as teaching Java itself is concerned, this is not a problem. However, many university students learn object-oriented modelling and design alongside Java programming, and I would imagine that many others do too. The conflict in notational convention could well cause problems for novices.
    • Java Gently follows the JDK1.1 standard; currently the latest release is JDK1.2.3. Students who download, or are supplied, a JDK package will undoubtedly get a release that is a generation newer than that assumed by Java Gently. I can see no particular advantages of introducing the new functionality of JDK1.2 into an introductory book (although other textbooks do so), but there are likely to be compatibility problems. These problems are likely to be minor, and dealing with them is perhaps an educational experience in itself. Nevertheless, some people are going to be put off by this.
  • My impression is that the author is more interested in, and has more experience of, the technicalities of programming than the philosophy of object orientation. A number of programming examples show class/object relationships that an OO designer would find dubious, I think. For example, ``Willow is an instance of Tree''. Surely Willow is a sub-class of Tree? The apple tree in my garden is an instance of Tree. Also some OO conventions that are widely followed have not been used. For example, convention dictates that class names are singular, not plural. ``Tree'' is a class; however many instances of Tree there are there is only one class Tree. This objection is, of course, a pedantic one. It will not stop people getting to grips with Java, but may frustrate those who are studying, or have studied, analysis and design courses as well.
  • I feel that if a topic is covered, it should be covered in depth. The later chapters on data structures seem to me to be too short to do justice to the subject.
  • Although the book is clearly intended for novice programmers, I feel that a novice programmer will usually also be technically inexperienced in a general sense. Using terms like `native machine instructions' in a description of compiler operation is unlikely to be helpful to these people unless they are explained. In my opinion, the whole explanation of the process of compilation and execution, and the use of the Virtual Machine, could benefit from more detail (or complete omission).
  • Although I would not like to claim that Java Gently contains errors of fact, there are issues of contention. I was particular concerned about how some technical details have been skipped over, especially when the authors state in the introduction that `correctness' is a key issue. For example, it is not explained why Java compiler output, although technically machine code, needs another translation stage to produce a running program. These issues are complex and subtle, but if touched upon should really be explained in full.

Summary

I would suggest that Java Gently is suitable for most people who want to learn Java as a first programming language. It will be useful whether Java is to be used for applets or more `traditional' applications. I don't think I would recommend it to people with extensive experience of other programming languages, because the fundamental concepts it covers in depth should already by familiar, and there are books that cater more closely to these peoples' needs.