Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Steve Oualline

Rating No ratings yet

There are lots of introductory C books, but this is the first one that has the no-nonsense, practical approach that has made Nutshell Handbooks® famous. C programming is more than just getting the syntax right. Style and debugging also play a tremendous part in creating programs that run well and are easy to maintain. This book teaches you not only the mechanics of programming, but also describes how to create programs that are easy to read, debug, and update. Practical rules are stressed. For example, there are fifteen precedence rules in C (&& comes before || comes before ?:). The practical programmer reduces these to two: multiplication and division come before addition and subtraction. Contrary to popular belief, most programmers do not spend most of their time creating code. Most of their time is spent modifying someone else's code. This books shows you how to avoid the all-too-common obfuscated uses of C (and also to recognize these uses when you encounter them in existing programs) and thereby to leave code that the programmer responsible for maintenance does not have to struggle with. Electronic Archaeology, the art of going through someone else's code, is described. This third edition introduces popular integrated development environments on Windows systems, as well as UNIX programming utilities, and features a large statistics-generating program to pull together the concepts and features in the language.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A practical, style-first introduction to C that treats readable, maintainable, debuggable code as the real goal—not just syntax that compiles. Best for beginners and self-taught programmers who want habits that survive contact with other people's code. 【Book Arc】 - **Opening (~0%–10%)**: Frames the book's philosophy—C is more than syntax; style, debugging, and maintenance matter—and situates C historically among higher-level languages, while orienting readers to the toolchain and the book's structure. - **Early (~10%–30%)**: Gets you compiling and running real programs across UNIX compilers, gcc, and Windows IDEs, then immediately pivots to style: meaningful variable names, declaration comments, and the discipline of writing for the next reader. - **Early–Middle (~25%–40%)**: Builds the language core—variables and types, characters and escape sequences, strings versus chars, arrays, integer qualifiers (short/long/signed/unsigned), and reading input with fgets/sscanf. - **Middle (~40%–50%)**: Moves from mechanics to craft: control statements (including switch fall-through pitfalls), the programming process from specification through pseudo-code design, testing, and the calculator example that ties design to working code. - **Late (~50%–90%)**: Excerpts indicate coverage of optimization, floating-point pitfalls (roundoff, precision loss, overflow, underflow), and advanced pointer material, though the excerpts do not cover these chapters in detail. - **Ending (~90%–100%)**: Culminates in a large statistics-generating program that pulls together the language features, plus the "Electronic Archaeology" material on reading and maintaining inherited code. 【Key Takeaways】 - **Write for the maintainer, not the compiler** (Early): Most programmer time goes to modifying someone else's code, so clarity and comments are engineering requirements, not niceties. (Early) - **Reduce rules to what you'll actually use** (Opening): Of C's fifteen precedence rules, the practical programmer needs roughly two; pragmatism beats completeness. (Opening) - **Style is taught alongside syntax** (Early): Meaningful names, per-declaration comments, and avoiding cryptic abbreviations form a "mini-dictionary" that makes code self-explaining. (Early) - **The full program lifecycle matters** (Middle): Specification, pseudo-code design, coding, testing, debugging, and maintenance are presented as one continuous process, illustrated by a calculator built and tested step by step. (Middle) - **Beware silent C traps** (Middle): Switch fall-through, assignment buried inside expressions, and comment errors that swallow declarations all produce correct-looking but wrong code. (Middle) - **Floating point is inherently lossy** (Late): Roundoff error, precision loss, overflow, and underflow are presented as fundamental issues, not edge cases. (Late) - **Electronic Archaeology is a core skill** (Ending): Reading, marking up, and commenting unfamiliar code—using the debugger and editor as browsing tools—is treated as a first-class practice. (Ending) - **A capstone program consolidates everything** (Ending): A large statistics-generating program integrates the language concepts into one coherent exercise. (Ending) 【Reading Tips】 - Deep-read the style and programming-process chapters early; they set the standard the rest of the book assumes and are the book's main differentiator. - Skim the IDE walkthroughs (Borland, Windows IDEs) if you already have a working toolchain—they are environment-specific and age quickly. - Treat the programming exercises as mandatory; the book teaches by doing, and the calculator and statistics programs are where concepts click. - Slow down on pointers, floating point, and "C's dustier corners"—the excerpts flag these as the harder, more error-prone material. - Keep the Electronic Archaeology chapter bookmarked for when you inherit real code; it is practical advice you will use repeatedly. 【Coverage Limits】 The excerpts cover the book's philosophy, early language fundamentals, style, and the programming process well, but only gesture at later chapters on optimization, floating point, advanced pointers, and the capstone statistics program. Specific chapter titles and detailed content for the late portions are not fully represented here.
Page 9
.........................................................80 More Side-Effect Problems ..........................................................................
View in text
Excerpt 2
item. 16. To exit the IDE, select the File|Quit menu item. Borland C++ 1. Create a directory called \HELLO to hold the files for our Hello World program. You...
View in text
Excerpt 3
ur name program to ask the user for his first and last name. Example 5-5 shows how we could write the program. Example 5-5: full1/full1.c #include <stdio.h>...
View in text
Excerpt 4
y” is removed from the specification, and the program, test plan, and specification are released. 114 Part II: Simple Programming This chapter also describes...
View in text
Excerpt 5
much further down in the program. By following a few simple rules, you can decrease the chances of having problems: • Put parentheses () around everything. I...
View in text
Excerpt 6
lare name static. In this manner, name is a permanent vari- able and will not disappear at the end of the function. Question 13-2: After fixing the function,...
View in text
Excerpt 7
index %d\n", middle); break; } if (data[middle] < search) low = middle +1; else high = middle -1; } } return (0); } Interactive debuggers work well for most...
View in text
Excerpt 8
rated in Figure 17-10. We have three out of four links done. The final link is previous_ptr of element 36. This is set with code: insert_ptr->previous_ptr =...
View in text
Tags
AI categories
Programming LanguageProgramming
ISBN: 1565923065
Publisher: O'Reilly Media
Publish Year: 1997
Language: English
Pages: 456
File Format: PDF
File Size: 10.3 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…