![]() |
|
I try to keep up with Dan Friedmans 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 dont 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 wont 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 dont know Java, you will be much more familiar with the language after reading this book, but you wont 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, youll end up knowing a lot that you didnt know, but you wont know what it is that you now know. Thats 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 its long been out of favor as a pedagogical tool. Its tricky, it can be pretty hokey, and if it isnt 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: Isnt it missing p?
Q: We dont specify fields in interfaces. And in any case, we dont 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 youre 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