
Preface
Why Is This Book Needed?
There are hundreds of books about programming, many of them about C programming.
Why do I write this book? Why should you spend time reading it? How is this book different
from any other book? Like many authors, I wanted to write this book because I perceive a
need for it. Because I think the approach in this book is better.
I divide existing programming books into two types: introductory and advanced.In-
troductory books are written for beginners. These books assume readers have no back-
ground in programming and explain the basic concepts, sometimes starting with the “Hello
World!” program: a program that prints a “Hello World!” message on the computer screen.
These books explain language features step-by-step: keywords, data types, control struc-
tures, strings, file operations, and so on. These books have a common characteristic: Every
program is short, usually one or two pages. This works because a short program can serve
to explain one new concept about the programming language. If we think of learning a
computer language as learning a natural language like English, Chinese, French, or Korean,
these books teach us how to write sentences and short paragraphs.
The second type of book is written for people comfortable with programming. These
books describe programs solving real problems. Many books about computer games or
graphics belong to this second category. The examples in these books are usually quite
long, sometimes thousands of lines of code, and too long to print inside the books. As a
result, only sections of the programs are explained in the books, and the source code is
either included on a CD or can be downloaded from the Internet. These books do not talk
about how to write programs. Instead, they focus mostly on algorithms to solve particular
problems and, sometimes, include detailed information on performance. You definitely won’t
find “Hello World!” examples anywhere in these books. Returning to the natural language
analogy, these books teach us how to write short novels, maybe a twenty-page story.
The problem is that it is difficult to jump from writing a paragraph to writing a novel.
A Book for Intermediate-Level Students
There are very few books for intermediate-level students. These students know something
about programming already. They are not surprised when they see if or while. They know
how to create functions and call functions. They can write short programs, perhaps dozens
of lines of code, but they are not ready to handle thousand-line programs. They make
mistakes often but most books talk about how to write correct programs without much
help with avoiding common mistakes. The students are unfamiliar with many concepts and
tools that can help them write better programs. These students need a stepping stone to
xxiii