Volume 9, Issue 4
Tricks of the Trade
In and Out
Download This Issue
Staff and Contributors
Introduction to Programming with Mathematica, Third Edition
Paul R. Wellin, Richard J. Gaylord, and Samuel N. Kamin, 2005,
Cambridge University Press, 550 pp., hardcover
This book introduces the Mathematica programming language to a wide audience. Since the last edition of this book was published, significant changes have occurred in Mathematica and its use worldwide. Keeping pace with these changes, this substantially larger, updated text includes new and completely revised chapters on numerics and on procedural, rule-based, and front end programming, and gives significant coverage to the latest features and functions in Mathematica 5.
This book is available in the Wolfram Research bookstore.Book Review
Associate Professor and Chair
Third editions can be a blasé affair. They rarely garner the attention of a new release, and in many cases they offer little more than minimal revisions and essential updates. In the case of programming books, you might expect the changes to primarily reflect new developments in the underlying software. That is not the case here. The third edition of An Introduction to Programming with Mathematica (hereafter IPM3) is in many respects an entirely new work. It has been revised from cover to cover, with many organizational changes and a substantial amount of new material. It includes coverage up to and including Mathematica 5.1. While the second edition was very well received, the third edition strikes me as an essential document.
The organization of this edition has changed substantially. The first two chapters have been renamed and rewritten but still provide an introduction to the software and the syntax and structure of the Mathematica programming language. I was struck immediately by the lucidity of the prose and the order of the topics. While the interweaving of concepts makes any linear ordering of Mathematica topics necessarily deficient, the choices made in IPM3 work well. The text also benefits from the considerable experience that Paul Wellin, the primary author for the third edition, has accrued in his role as director of the Wolfram Education Group. It will be obvious to any educator that a great amount of reflection and experience in teaching these materials has informed and refined their presentation since the second edition.
The third chapter, Lists, retains much of its original character and adds a new section on strings. But from here on out it is in many ways a completely new book. Chapters four through six are organized by three distinct programming styles: functional, procedural, and rule-based programming, respectively. Much of this material appeared in the second edition, and in much the same order, but the organization obscured this interpretation. However, much here is also new. For example, Block and With are now discussed (they did not appear in the second edition) alongside Module. The treatment is not meant to be comprehensive, but it is sufficient to quickly see the major distinctions between these three commands, and it is a clear improvement over the second edition. Additionally, Thread appeared only in the exercises in the second edition. It is discussed in greater detail in this edition, with carefully chosen examples, such as threading Rule over two lists to get a list of replacement rules, a simple and useful technique.
Moreover, the third edition makes excellent use of simple commands that reveal and emphasize the underlying structure of expressions, such as following an outputted list with the command Map[FullForm,%]. The liberal inclusion of such commands encourages the reader to think about the underlying structure of expressions throughout, and this lends considerably to the book's merit.
Chapters on Recursion, Numerics, and Graphics Programming are preserved in IPM3, with a nice section on merge sorting added to the Recursion chapter. The Numerics chapter is largely rewritten. In particular, the section on precision and accuracy is greatly expanded and provides as clear an introduction to those ideas as I have seen anywhere. New sections on sparse arrays and packed arrays are also included to provide coverage up to Version 5.1. In the Graphics chapter, the material is reorganized, but the basic content is preserved.
A new chapter on Front End Programming is a welcome addition. After carefully introducing the idea that cells and notebooks are themselves expressions, a brief but valuable presentation on such concepts as TextData, BoxData, and GraphicsData is given. GridBoxes are presented in some detail (there is a gem of a short program included to produce truth tables for logical expressions), and there is a brief but informative section on button programming. New also are two appendices, covering how expressions are evaluated and debugging.
It is worthy of mention that unlike the second edition (which was written in LaTeX) the third edition is produced directly from Mathematica 5 notebooks, using style sheets made by Wellin and slightly modified commands from the standard AuthorTools package to produce the table of contents, index, and so on. That is, anyone could, in theory, follow a similar path and use Mathematica to produce a production quality text. This is not the first book to be written in Mathematica, but it is far and away the most beautiful. From page layout to production quality, the work is on par with any technical text produced by any publisher. This should give future authors of Mathematica texts something to think about.
In conclusion, IPM3 is a welcome addition to the literature. The choice of topics and their presentation are lucidly informed by considerable experience. The writing style is straightforward and clear. The authors stick resolutely to their goal of producing an introductory text, not a complete treatment, on programming in Mathematica. As such it is highly successful, full of useful examples that show how the ideas can be immediately and fruitfully exploited. The only bad news is that unlike many other third editions, owners of IPM2 may find that they need to shell out for the new edition.
About Mathematica | Download Mathematica Player
© Wolfram Media, Inc. All rights reserved.