skip to main content
Skip header Section
Expert C programming: deep C secretsAugust 1994
Publisher:
  • Prentice-Hall, Inc.
  • Division of Simon and Schuster One Lake Street Upper Saddle River, NJ
  • United States
ISBN:978-0-13-177429-2
Published:01 August 1994
Pages:
353
Skip Bibliometrics Section
Reflects downloads up to 23 Sep 2024Bibliometrics
Skip Abstract Section
Abstract

This is a very different book on the C language! In an easy, conversational style, Peter van der Linden, of Sun's compiler and OS kernel group, presents dozens of astonishing examples drawn from practical experience, including: Software that blew up the space probe to Venus The C bug that shut down the entire AT&T phone system C programmer job interview secrets Why programmers can't tell Halloween from Christmas day The C code for a complete BASIC interpreterExpert C Programming reveals the coding techniques used by the best C programmers. It relates C to other languages, and includes an introduction to C++ that can be understood by an programmer without weeks of mind-bending study. Covering both the IBM PC and UNIX systems, it is an entertaining and educational romp through C showing how experts really use it. Expert C Programming is a must read for anyone who wants to learn more about the implementation, practical use, and folklore of C."Not just clearly written, but fun to read. The tone and style of this text should make this a popular book with professional programmers. However, the tone of this book will make it very popular with undergraduates. Appendix A alone would make the purchase of this book a must. It's filled with great advice." -Professor Jack Beidler, Chairman, Department of Computer Science, University of Scranton"So that's why extern char *cp isn't the same as extern char cp. I knew that it didn't work despite their superficial equivalence, but I didn't know why. I also love the job interview test questions on C." -David S. Platt, Rolling Thunder Computing"In Expert C Programming, Peter van der Linden combines C language expertise and a subtle sense of humor to deliver a C programming book that stands out from the pack. In a genre too often known for windy, lifeless prose, van der Linden's crisp language, tongue-in-cheek attitude, and real-world examples engage and instruct." -John Barry, author of Sunburst, Technobabble, and other books

Contributors
  • Sun Microsystems

Reviews

Alan Cole

Intended for programmers who already know C, this book provides lessons, tips, and techniques from some of the dark corners of the C language. The author makes the whole journey interesting by including folklore and anecdotes, though not all are relevant to C; for example, we learn that Donald Knuth's first publication was in Mad magazine. Chapter 1 discusses the early history of C and its evolution to the current ANSI and ISO standard, and summarizes some of the differences between Kernighan and Ritchie (K&R) C and ANSI C. Chapter 2 describes some of the commonly misunderstood or misused features of C, such as the switch statement's fall-through default and “incorrect” precedence for some operators, and laments the fact that lint was ever separated from the compiler. Chapter 3 shows how to understand C declarations, providing both a “magic decoder” diagram and a version of the cdecl program to translate declarations into English to help make sense of “the horrible C syntax.” Chapter 4 discusses why C arrays and pointers are not the same, deferring a discussion of when they are equivalent to later chapters. Chapters 5, 6, and 7 venture away from the language itself. Chapter 5 describes how to link programs, how to construct libraries, and why dynamically linked libraries are better than statically linked libraries. Chapter 6 discusses the runtime organization of a program, how the a.out file is organized into segments, how procedure activation records are used, how setjmp () and longjmp () work, how the stack is organized, and so on. Chapter 7 describes some of the runtime problems to which C programs are vulnerable, including memory leaks and segmentation and bus errors, and describes the memory architecture of the Intel 80x86 family of processors. Chapter 8 provides a variety of tips, including advice on function prototyping and casting. Chapters 9 and 10 supplement the earlier discussion of arrays and pointers. Chapter 11 gives a cursory introduction to C++, describing some of its key ideas, summarizing some of the restrictions in C++ that are not available in C, and discussing features of C++ that mean something different in C. An appendix gives some tongue-in-cheek tips for programmer job interviews. No extensive discussion of the C preprocessor is included, reflecting the author's view that “the only appropriate use of the preprocessor is for macros that don't require extensive discussion.” Occasional “programming challenges” have been integrated into the text. Example programs or program fragments are typeset well, and in the several I tried, I found only one minor error. Several of the chapters contain pointers to further reading, though providing a bibliography of C literature is obviously not one of the author's goals. One weakness of the book is that when the author departs from the topic of the C language proper, as in his coverage of linking and runtime organization, the discussion lacks generality. The many detailed references to the Sun product line, and occasional less-specific references to the MS-DOS operating system, suggest not only the author's job, but what he runs on his home PC. Comments such as “y ou can look at the individual phases of compilation by using the -# option” and “the -D option to ld was introduced with SunOS 5.3…” are not helpful to the wider audience addressed by the remainder of the book. Also, the chapter on C++ seems an afterthought; its more than 30 pages detract from the rest of the book, yet provide too superficial a coverage to be of much real use. On the positive side, the author succeeds in his goal of helping the reader achieve a more complete understanding of C and some of its idiosyncrasies, the better to avoid C's potential pitfalls. He writes in a lively, humorous, and enthusiastic style that should keep the interest of all but the most jaded reader, and has provided a book for the C programmer that is well worth reading.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Recommendations