Kirk Thomas is currently working for Knight-Ridder Financial Services as Software Development Team Leader. He has been programming embedded systems and network applications in C for eight years.
C By Example is an introductory C-programming text designed to be used in textbook fashion to teach C programming to beginners, as well as round out intermediate and advanced programmers' understanding and usage of C. It intends to do this with "a straightforward, friendly, and comfortable feel that provides a stepping-stone style to C for beginners." Through the use of a clear writing style, excellent organization and page layout, and an abundance of examples and review questions, author Greg Perry achieves these goals.
C By Example is organized into seven main sections, each with multiple chapters, followed by six appendices and a glossary. The book begins with an introduction to C describing the basic components of a C program as well as the components that make up a programming environment (i.e. editor, compiler, linker, etc.). Then it moves from the basic elements of C on through the more complex issues of variable scope, library functions, arrays, pointers, and file I/O.
Each main section is divided into several chapters. Each chapter uses examples to further demonstrate each subtopic, and each chapter concludes with a set of review questions, complete with answers in the back of the book, and with review exercises to give the reader a chance to put the material to work. I found the examples and review questions very pertinent. They cover a wide range of skill levels. The review exercises lean more toward the beginning programmer, but follow the basic premise of providing a directed learning experience for the review topic.
Unlike many similar books that build a sample application as the book progresses, Perry's approach is to have each example focus on a single topic and to fully demonstrate that topic. This approach makes the book even more useful as a permanent learning reference, since the reader can access a relevent section of the text to gain insight into performing some specific task using C, without having to remember the structure of the book as a whole. It also helps the book achieve its aim of being for the intermediate and advanced programmer as well as the beginner. Each example is clearly identified as beginner, intermediate, or advanced material, making it easy for programmers of all levels to streamline their study. For those who want to study a complete sample application, there is an appendix containing a mailing-list application, although it is a very simple application intended only for true beginners.
The use of examples is only one attractive aspect of C By Example. The organization and layout of this book is also very good. The book is organized from easiest material first through more complex material at the end. The table of contents clearly defines the structure of the book, and gives enough detail to allow the reader to easily find a section covering any given topic. The book also contains an excellent index. Page layout is well done, clearly presenting the material while being visually pleasant. Icons delineate programming tips, cautions, and notes, as well as indicating the complexity level of examples and review questions.
Greg Perry augments the organization and layout of the book with a very comfortable writing style, one which always remembers that his main audience is beginning C programmers, but always assumes an intelligent audience. Since the self-studying readers can always stop and reexamine a section that requires further understanding, the author keeps the pace of the book lively so that more advanced C programmers will stay interested.
I found reading and using C By Example to be very enjoyable and had no complaints. However, including a chapter which focuses completely on the pros and cons of C as a programming language would make the book more complete. There are many references throughout the book to issues of portability, etc., but the C language, more than most others, has many very strong aspects, while its weak points also stand out. It's important for any programmer to understand what makes a language better or worse for different environments, and although C By Example is already 754 pages, it would benefit from highlighting this issue more directly.
C By Example presents itself as a beginning how-to book for learning to program in C, that also provides useful information for the intermediate and advanced programmer. Anybody who purchases the book with this in mind will be very pleased, as the book delivers exactly what it describes. Augmented by a true C reference book, such as K&R, somebody wanting to learn C programming could do a very nice job with this book. It also provides an easy way for more experienced C programmers to gain knowledge of unfamiliar aspects of C programming. And, at $21.95, I'm certain most students would consider this cheap for a textbook. An accompanying disk can be ordered for only $10.00 as well, making this book a real bargain.
Title: C By Example
Author: Greg Perry
Publisher: Que/Prentice Hall
P.O. Box 90
Carmel, IN 46032
(800) 448-3804
Price: $21.95
ISNB: 0-88022-813-X