Electronic Review of Computer Books

[ ERCB Home | New | Feature | Brief | DDJ | Letters | Links ]

[an error occurred while processing this directive]

Vital Statistics

Title A Little Java, A Few Patterns
Authors Matthias Felleisen and Daniel P. Friedman
Publisher MIT Press
Cambridge, Massachusetts
http://mitpress.mit.edu
Copyright 1997
ISBN 0-262-56115-8
Pages 200
Price $20.00


A Little Java, A Few Patterns

While in Bloomington, Indiana recently, I stopped by the campus bookstore and bought a copy of Matthias Felleisen and Daniel P. Friedman’s A Little Java, A Few Patterns (MIT Press, 1998, ISBN 0-262-56115-8).

I try to keep up with Dan Friedman’s books. I was his graduate assistant many years ago, and had a kind of epiphany back then when I read his entertaining and insight-generating book The Little Lisper (Scientific Research Associates, 1974, ISBN 0-574-19165-8). It taught me to think in Lisp. I readily admit that this is a skill not in high demand today, but I think of it like the Latin I learned in high school&emdash;it helps me to understand other languages.

This new Java book, like the old Lisp book, uses a rigid question-and-answer approach that you would think would be artificial and possibly annoying. But Friedman put it to brilliant use in the Lisp book. I was curious to see how it worked for Java, and what Felleisen and Friedman had to say about design patterns.

I should have known better.

If you don’t know anything about design patterns, you will be better equipped to read books on the subject after reading A Little Java, A Few Patterns. You will have a feel for Java interfaces, the Visitor pattern, and the Interpreter, Composite, Template Method, and Factory Method patterns. But you won’t be aware of having learned a darned thing about design patterns, since object-oriented programming and design patterns are never explicitly mentioned in the body of the book, except in cryptic footnotes.

Similarly, if you don’t know Java, you will be much more familiar with the language after reading this book, but you won’t have seen a formal or informal specification of the language, or even of the subset of the language that Felleisen and Friedman use. Any knowledge of Java conveyed by this book will be subliminal or osmotic.

Furthermore, you will learn how to work in the functional programming paradigm that Friedman prefers, and see how it complements the object-oriented paradigm, but without a word of explanation of what functional programming is. In short, if you work through the book, you’ll end up knowing a lot that you didn’t know, but you won’t know what it is that you now know. That’s because Felleisen and Friedman teach programming like aerobics. They leave out all the rules and definitions, and have you learn by sweating through short exercises.

Their method is called, or used to be called anyway, programmed learning, and I suspect it’s long been out of favor as a pedagogical tool. It’s tricky, it can be pretty hokey, and if it isn’t done well it can be an awfully roundabout way of putting across complex concepts. But Felleisen and Friedman use it masterfully, taking care with the order in which subjects are developed, using redundancy and humor to good effect, even playing with the format for humorous effect. Here the answer starts asking the questions and cops an attitude:

Q: Here is the interface for PiemanM...

A: Isn’t it missing p?

Q: We don’t specify fields in interfaces. And in any case, we don’t want anybody else to see p.

A: Whatever.

Whatever; it works. I found the book charming and instructive, a worthy companion to the authors’ The Little Lisper, The Little Schemer, and The Little MLer. If you’re trying to get the “feel” of design patterns, Java, or functional programming, you would do well to read A Little Java, A Few Patterns.

-- Michael Swaine


Copyright © 1998 Electronic Review of Computer Books
Created 5/23/1998 / Last modified 5/23/1998 / webmaster@ercb.com