Oh! Pascal!
Bob Williams, Mac Developer/Consultant, TriVectus

Oh! Pascal!

Author: Doug Cooper
Publisher: W.W. Norton & Company, New York and London, 1993
ISBN: 0-393-96399-3 (Mac disk), 0-393-96398-5 (PC disk)

One word describes this book: Excellent. Assuming you have no prior programming knowledge, the book starts off with a very quick intro to hardware showing how it relates to programming environments. It then moves into actual programming, where it first discusses the basic Hello World program in great detail as a way to introduce such concepts as statements, reserved words, and comments.

After that, it shows how to read syntax diagrams and talks a bit about general program style.

That's just the "Read Me First" and "Read Me Second" parts of the book. Only after these parts come the actual chapters.

The first chapter covers the very basics, like expressions, procedures, and variables. At the end of the first chapter, there's a discussion of bugs and programming style (writing good code that prevents bugs and is easy-to-read is a topic that is emphasized heavily throughout the book).

The next couple chapters cover functions, simple program engineering, and design approaches (top-down, bottom-up, etc.), as well as coverage of programming ethics.

From there, a number of chapters cover the various parts of Pascal--for statements, while loops, arrays, and so forth--in a well-organized and building manner.

After the basics are covered, there's an entire chapter devoted to software engineering, covering things like defensive programming and the program life cycle.

Then the author steps into more advanced topics, beginning with the file and set types, going through pointers, and finally covering recursion in the final chapter.

After the main chapters, the author includes five very nice appendices. A covers details not covered in the main chapters, including goto, variant records, pack/unpack, procedures/functions as parameters, and shorthand declaration of types. B is titled, "Useful Procedures," and includes among others a random number generator. C offers a discussion of real arithmetic and its pitfalls. D, called, "Pascal Pages," gives a brief overview (including syntax) of all the Pascal ideas... case statements, for statements, records, sets, etc. And finally, E discusses the included disk, compiler directives, and Extended Pascal.

The book is written in a very friendly style that emphasizes concepts over syntax memorization. There is very easy-to-read and understand code used to demonstrate all ideas that oftentimes is useful in its own right in real programs (this is especially true with the more advanced topics). The author goes to great lengths to keep things clean and neat, such as typesetting the manuscript to avoid page breaks in code as much as possible.

The book is also very complete without being overwhelming. Starting off with the raw basics, before you know it, you're covering more advanced things like sort algorithms, stacks, linked lists, the binary sort, and even the quicksort. All these concepts are illustrated with excellent diagrams (much improved over previous editions) and interesting programs. Some of the programs used to demonstrate concepts include Approximating Pi, Identifying Palindromes, Counting Words (in a text file), The Towers of Hanoi, and Maze Searching and Backtracking.

The book was actually written with the intention of it being used in a classroom. However, it's not belittling to the normal reader. For the beginner, it's emphasis on writing structured, commented code is an excellent way to get started.

The book would also be very good for someone who already knows another language but wants to learn Pascal. This is how I originally used the book... I was in high school, and scheduled to lead a team to a programming contest. For the qualifying round we decided to use Pascal, and we learned it with this book in one week, having had extensive experience with BASIC. And to this day, I still occasionally use the book as a reference to look up more obscure Pascal syntax that I rarely use.

The included disk has all of the sample code on it, plus a simple Pascal compiler (though the free THINK Pascal 4.5 would be a much better choice for Mac users). The code includes implementations of all the sort algorithms and data structures discussed in the book, and can easily be used in real programs. Though there are Mac and PC versions, Mac users can mount the PC disk and use the code samples, which are simple text files.

In summary, this is a great book that will teach a beginner while keeping their interest, and yet still be useful to him or her after progressing to more advanced levels. A definite must-have for any Pascal programmer.


Copyright © 1998 Bob Williams