Showing posts with label book review. Show all posts
Showing posts with label book review. Show all posts

Friday, February 27, 2009

Mini-Review: Learning Java by Patrick Niemeyer and Jonathan Knudsen

Once upon a time there was a neat little book called Java in a Nutshell. It described the Java language, feature by feature, and did a great job of teaching the language. It was targeted at people who were already programmers in some other language, but at the time there weren't a lot of people who'd consider using a new and somewhat narrowly-defined language like Java as a first programming language.

The first edition was pretty compact, true to the "Nutshell" name. Then Java grew, and the book grew with it. Now the current edition is huge, and that's even after they've moved out a lot of the examples and more detailed explanations to make room for everything else.

For those looking to learn Java, O' Reilly, the publishers of Java in a Nutshell, have a different book. It's appropriately named Learning Java. Like the original Java in a Nutshell, it's targeted at people who already know how to program. The title and cover design of this book don't suggest that, however, my feeling is they suggest that this is a beginner's book. Which it isn't, and the text of the book itself never says that it is.

The book is a good overview of Java for programmers learning Java. Beyond assuming that the reader is a programmer, it also assumes familiarity with object oriented language concepts. It briefly sketches them out, but if you're not already familiar with C++, Smalltalk, Objective-C, or some other object oriented language this book is not the place to start.

Learning Java is amazingly comprehensive. Java is a huge language with a lot of features. In some places the book has to cover things very briefly, in others it takes time to delve in a bit deeper. Those places where things are covered briefly often give short shrift to the subjects covered. Several related features will all get covered together, and instead of each one getting its own code example, several features will be demonstrated in a single piece of code that mashes them all together in one omnibus program. This makes understanding each individual subject much harder. There are also a lot of code snippets through the book in places where a short, complete program would provide a much better illustration than a few isolated lines of code.

In compensation for this, there are some code samples in the book that are excellent demonstrations of Java's power as a programming language. For example there are complete programs for a basic web server and a basic web browser in the book. These are both good demonstrations of Java features and a good jumping off point for the reader to start their own program. Threads are likewise covered with useful examples.

These examples make the book worth owning. It makes a great second or third book for someone learning Java. I wouldn't recommend it as the primary book for learning Java, however, only as an adjunct to some other book. My inclination would be to use this as a "third book." The first book should be a good teaching book for the level of the learner. The second book should be a strong, focused reference book for the areas of the language that are most important to that person's learning level. The third book should be a backfill with a broader range of examples and be a source of explanations with a different perspective from the first book to help out when the first book falls short of being clear for the learner.

This book is one of my favorites of those I own for that "third book" role. I draw examples from it for my classes, and look to it for supplementary explanations of features of Java. I've used it with students having trouble with concepts in other texts, having them work through the related portions of this book. It's been a great help that way.

Final Grade: 75%, C

Pros:
Some wonderful example programs.
Very comprehensive.
No fluff.

Cons:
Crowds too much into too few stand-alone example programs.
Does a poor job of teaching object oriented concepts.
Many sections are rushed.

Recommendation:
Get it to fill out your Java library, the excellent examples and good descri1ptions of areas of Java often not covered well elsewhere makes it worth having on the shelf. Don't buy it as a primary learning text, however, no matter what your level as a programmer.
StumbleUpon

Monday, August 4, 2008

Mini-Review: Beginning Programming with Java for Dummies by Barry Burd

Of the books currently available, this one is my favorite for teaching non-programmers the basics of programming. This is in spite of the fact that it goes against a few strongly-held opinions of mine. I have worked through the book myself, and had a student with no prior programming experience use the book for self-study. So the opinions here are based on my own experience as an instructor and the feedback I've gotten from the student.

The writing style of this book is fun and easy to read. This is always a big plus for books that teach a complex and unfamiliar subject. The material is also varied from chapter to chapter, meaning that you won't be going to sleep writing different kinds of loops for three straight chapters. Subjects are interleaved, for example, there is a section on using files that breaks up material on loops and iteration.

The start of the book is quite leisurely. This is valuable in a book for non-programmers, I feel. The pace of the book picks up as it goes, so don't be fooled into thinking the book is just a brief tutorial that's been padded out into book length. The early sections are also quick reads, and sections on installing Java can be scanned or skipped over as appropriate. The pages dedicated to installing the JDK are there for a good reason, though. My experience is that just getting the JDK installed and running is one of the biggest hurdles for non-programmers who want to learn Java.

The differences I have with this book are few, but significant. The first is that graphics are left until the very tail end of the book. As I've stated elsewhere, I'm a proponent of teaching graphics early. I feel they're a good motivator for new programmers, and they allow new programmers to visualize the effects of their program's flow control structures in a way that rows of numbers can't equal.

The second difference I have with this book's approach is the use of an integrated development environment (IDE) right from the start. I've also commented in a prior article why I think it's a good idea to at least be familiar with common command line operations before starting with the IDE. I feel that starting with an IDE right off glosses over some skills that are crucial to programmers at any skill level.

The third concern I have with the book is that it recommends the use of a Windows-only IDE for use with the book. Now, if this were a .Net book or something similarly tied to a single platform I wouldn't have any problem with this. But this is a Java book! Why not a good multiplatform IDE written in Java? It's not like there aren't any good choices. My student was working on a Mac, and was able to complete the work in the book with no problem using, primarily, Arachnophilia but also using BlueJ for the latter part of the book.

I would also be concerned that people seeing the recommendation of a platform-specific IDE early in the book would think that therefore the book itself contains a substantial measure of platform-specific content. It doesn't, but flipping through the start of the book isn't enough to make that clear.

The focus of the book is on the basics of programming. It does not dip heavily into object oriented programming. It simply uses Java and its facilities to teach introductory programming in much the same way as one might use C or Pascal for the same purpose. I don't yet consider this a problem, though Greenfoot may convince me that objects and classes should be right up front now. However, I feel that starting with this book and then moving on to other resources like Greenfoot and Head First Java to develop a better understanding of Java and object oriented programming is a perfectly acceptable way to learn.

Even with its problems, I consider this book to be the best on the market for a non-programmer. It does not go as deeply into Java as Beginning Programming in Java for the Absolute Beginner, but it's an easier read and overall I like the structure better even though it covers less.

Final Grade: 90%, A

Pros:
Easy to read.
Good pacing of material.
Doesn't get boring.
A very good introduction to programming.

Cons:
Uses an IDE, and recommends a Windows-specific IDE (though any multiplatform IDE will work.)
Graphics are left until the very end.
Limited scope, but it's easy to go on from here.

Recommendation:
Get it if you're a non-programmer looking to learn how to program. You may also want to get the "next" Java book you plan on using at the same time, and start referring to it as you work through this one. You should consider downloading Greenfoot then going through its tutorials to get a grounding in classes and objects. You'll also want to get a multi-platform IDE for Java, even if you are on Windows. You may decide to use Greenfoot for this, or BlueJ or Arachnophilia (or perhaps even Eclipse or NetBeans, if you have a mentor to help you get started with them.)
StumbleUpon

Tuesday, July 22, 2008

eBook Recommendation: Java Programming for Kids, Parents and Grandparents by Yakov Fain

Java Programming for Kids, Parents, and Grandparents by Yakov Fain is a neat little ebook that provides a brief introduction to Java. It has some great exercises in it, and if you're doing an install of the SDK to a Windows system it gives directions in a fashion that is somewhat more direct than the ones from Sun.

While my preference is to introduce graphics before getting into flow control, the book puts flow control first. However, the material goes so quickly, and the program exercises are so much fun that it doesn't matter much here. The final exercises in the book are a couple of simple graphical video games, and it doesn't take too long to get to them.

I haven't tested the book on any real students yet, but I probably will. Once I do I'll post a more in-depth article on this book. The writing style is light, occasionally a bit condescending, but the material itself is well done.

Thumbs up to those resposible for writing and distributing Java Programming for Kids, Parents and Grandparents. A body of good material like this is what makes programming accessible to ordinary folks who might otherwise think you need to live like some sort of egghead monk to learn this stuff.

The contrast between the approach in this ebook with the first edition of Java Programming for Dummies (the Aaron Walsh version, not the fine book by Brad Burd) is striking. Essentially, the first Java for Dummies book told you "Java is hard, you're a Dummy. Since Java is too complicated for a Dummy like you, we're going to teach you JavaScript instead, even though you thought you bought a book on Java."*

The Fain book didn't bother to tell me what I can't do. It was too busy telling me what I can do. On top of that, Yakov Fain's book is a free ebook, so it cost me $25 less than the Dummies book. (Yeah, I still feel burned on that one. ;) )

* It wasn't bad at all as a book on JavaScript, BTW. But it wasn't being sold as a book on JavaScript. It even has a short section on Java applets and chapter titles that refer specifically to Java inside to confuse the issue for those who see the cover screaming "Java" and take the time to flip through it. This book put me off Dummies books for about ten years, and only the excellence of many of their current books brought me back.
StumbleUpon

Tuesday, July 1, 2008

Mini-Review: Beginning Programming in Java for the Absolute Beginner, 2nd edition, by John P. Flynt, Ph.D.




For non-programmers looking to make the transition to becoming a programmer, this book is a fine place to start. It works well as both a self-study text, and as a classroom textbook.

There aren't a lot of Java books out there written to teach the language to non-programmers. In many ways the Java language was created for C programmers, and most of the available books are written for the same audience--programmers familiar with C or C++. To my knowledge, there are presently only two books that are generally available intended to teach Java to the non-programmer. Edit: since this was written, several more books of this type have come out. The situation is far better now!

The First Step is Always the Hardest

As appropriate for a beginner's book, this book starts with a fair amount of detail on how to get set up and get started. It's challenging to strike the right balance with this material, some beginners get up and running with a minimum of effort, others run into trouble from unanticipated sources--leaving them in a position where almost no amount of information seems like enough. I think this book strikes a good balance, referring to external sources for supplemental material. Best of all, it maintains a platform-agnostic approach. You would think this is a given in a book teaching a platform-agnostic language, but it's not.

As appropriate for a beginner's book, the book teaches the principles of programming first, and Java second. The exercises of the seven chapters take the form of console, or command-line applications. Graphical applications are introduced about 2/3rds of the way through the book, in chapter 8. Most of the examples take the form of simple games.

The book teaches the basics of programming--variables, operators, flow control and such--in the first four chapters. The pacing of this material is very good, it teaches enough to not only cover the absolute core but some of the extra twists, and moves through it before it becomes tedious. Chapters five through seven get into object-oriented programming. The placement of this material in the book is great, going any further without introducing the material would be a bad idea, and any sooner would have been confusing to non-programmers.

Comprehensive Coverage

Overall the book covers a lot of ground. Someone working through this book from beginning to end is going to come out with a strong knowledge of a lot of Java. Each chapter ends with a number of exercises, which are essential additions to the examples in the text for the student to have the ability to really synthesize the information and go from program copier to a writing their own programs.

The breadth of the coverage is one of the books' strongest points. The material is well-paced, and the many complete examples of working programs are a huge advantage over the snippets that many books rely on. Exception handling, class creation, and many other subjects are covered. About the only thing I could ask for that isn't here is a brief introduction to threads, but I wouldn't even consider the idea of adding this if the book wasn't already so comprehensive.

Errata

One of the problems this book has is the typos in the program text. They are not numerous, and often even beginners can see the flaws once they know to look for them. They aren't common, only a few of the programs have errors in them. But they can be frustrating when they occur for those who are learning on their own.

Reaching Too Far?

Some of the examples try to do a bit too much, too. Rather than concentrating on one key point they add several new items at once. The centerpiece of each program is always the subject of the lesson, but additional little items get slipped into the examples. It's also worth noting that the examples that use special characters don't account for the configuration of the Terminal in Mac OS X that interferes with using these characters in the same fashion as on other platforms.

The later examples in the book also tend to get quite long. This results in a lot of typing by the beginner before they see any results. Likewise, this ties into the problem with many exercises not concentrating on the specific subject of the lesson. Particularly when graphics are introduced, I would have liked to see very short, focused examples that do only the absolute minimum to open a window and do some drawing, then add other interaction (such as the mouse, keyboard shortcuts, widgets, etc.) piecemeal. I ended up using my own example programs in my class to introduce graphics, and it went considerably smoother than I have had it go with students that followed the book alone. (I will be posting these examples in this blog when I get into graphics.) I would also like to have seen graphics introduced earlier in the book, allowing more examples to use graphics. This would also start the student making what look like "real applications" in the modern environment earlier in the learning process.

Summary

I feel this is a great book for a new programmer. Further, Java is a great language for a new programmer. Groovy may be better, but the resources available for a beginning programmer are still slim at this point, and I haven't actually had the experience of teaching it to beginners yet. Edit: There are many other languages that run on the JVM now, the others that can access the graphics and sound facilities natively (rather than through special calls to access Java syntax) would also be good candidates.

Final Grade: 85%, B

Pros:
Good material and pacing, (mostly) fun examples.
Covers lots of Java, and does it well.
Platform-agnostic.

Cons:
Typos in examples.
Discussion gets dry in places.
Examples in the later parts of the book are long and do too much at once.

Recommendation:
Buy if you're a non-programmer looking to become a programmer and want to do it with just one book. If you're willing to work out of more than one book, you may also want to consider Beginning Programming with Java for Dummies by Brad Burd (I'll be posting a mini-review of this book soon.) This also makes a good textbook for teachers looking for a class textbook thanks to the organization of the book and the chapter exercises.

StumbleUpon