||New Reviews| |Software Methodologies| |Popular Science| |AI/Machine Learning| |Programming| |Java| |Linux/Open Source| |XML| |Software Tools| |Other| |Web| |Tutorials| |All By Date| |All By Title| |Resources| |About||
Keywords: C, introduction to programming
Title: Programming In C
Author: Stephen G. Kochan
Publisher: SAMS Developer's Library
Verdict: A comprehensive and useful introuduction to C programming for the beginner
Now into it's third edition, Stephen Kochan's 'Programming In C' remains a superb introduction to the subject.
Kochan assumes no prior knowledge, and the book starts with the absolute basics, explaining what a high-level language is, describing the process of coding and compilation and program execution. Wisely a platform-agnostic approach is adopted and no particular operating system or development environment is assumed. The book is usable for would-be C programmers working at a command-prompt in Windows, Linux or any other operating system, though there is a slight emphasis on the use of Unix-style utilities. A first program - which simply prints a message to the console - is used to illustrate the how the code, compile, link and run process works.
With these basics out of the way the fun can begin. Variables and data types are introduced and then used with simple arithmetic expressions. The examples are clear and the code explained in simple, concise language. There are no sudden leaps of understanding required, Kochan takes pains to make sure that material follows a logical sequence and that his readers are able to follow as the material becomes steadily more advanced. Program flow and looping each get chapters, ensuring that the key elements of programming are clearly understood.
Arrays also get a chapter, which begins with a basic single-dimensional array of integers and moves on to character arrays (though not strings at this stage), multi-dimensional and variable-length arrays. Functions are introduced in the following chapter, which not only covers functions and arguments, but also looks at top-down programming and the principles of structured design. Additionally much of the previous material is revisited, particularly with the coverage of functions and arrays. Recursion is also introduced, revisiting earlier code in order to show how recursion can often simplify or refine loops.
Structures and character strings are covered before the book finally gets to the topic of pointers in chapter 11. It should be noted that the coverage of strings does not cover some of the more advanced topics, such as wide-characters or Unicode strings. It is more than sufficient for an introduction however. The coverage of pointers is handled very well. This is an area that many beginning programmers find problematic, but the explanations in this book are clear and to the point.
After dealing with pointers the book proceeds with chapters on bit operations, the pre-processor, enumerated data types and more. There is a very useful chapter on working with larger programs, which explains the use of multiple files, header files and inter-module communication. In addition the use of make and CVS are covered, along with a quick introduction to common utilities such as grep, sed etc. I/O also gets a chapter, which looks at printf/scanf in more detail and then looks at file I/O for the first time.
Finally there are chapters on a few miscellaneous topics, including unions, dynamic memory allocation using calloc and malloc (though ideally these would have been covered in more detail earlier in the book), debugging using the gdb debugger and a fly-past of object oriented programming. A number of appendices complete the book, including a language summary, the standard C library, the gcc compiler and more.
The code used throughout the book is generally well-chosen and useful serves the purpose of illustrating the concepts in the text. Unlike some programming titles there is no big project developed in the text. This means the functions that are developed are pretty much stand-alone, but it does mean that there is no large body of code to pull the various strands together. Whether this is an issue depends on the reader, those looking for more substantial coding examples would be well-advised to take a look at Ivor Horton's 'Beginning C', which covers much of the same ground and at much the same level.
In all the book covers most of the major areas that any introductory volume should cover. The writing is clear and comprehensible, and the fact that the book remains popular 20 years after the first edition was produced is testament to the fact that generations of programmers have found it useful.