Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Robert Beisert

Rating 3.5 AI initial rating

Evermore Instructional, 2016. There is the right way to do things, and there's the wrong way to do things. Unfortunately, most of us don't really take the time to figure out which way is which.Robert lays out 24 patterns of thought and design that tend to produce faster, more reliable, and easier to maintain code without noticeably increasing the difficulty or decreasing the speed of coding. In this book, you'll learn about Niklaus Wurth's 3-10 rule, speed-documenting tools, and the techniques that keep memory leaks out of your code.

AI Reading Assistant

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

AI guide
【One-Line Pitch】 A compact, opinionated field guide to the small habits—naming, documenting, logging, error-handling—that make code faster to read, safer to change, and cheaper to debug. Best for working programmers (especially C and systems-adjacent developers) who want practical discipline without a heavy methodology. 【Book Arc】 - **Opening (~0%–10%)**: Sets the premise—most bugs and maintenance pain come from unexamined habits—and frames the book as 24 lightweight patterns usable in any language, with C as the running example. - **Early (~10%–32%)**: Covers the "simplifying your work" layer: documenting as you go, using editor features (vi yank/mark, matching braces) to keep headers and code in sync, layered comment styles, and leaving environment defaults alone. - **Middle (~32%–55%)**: Moves into naming and interface design—meaningful return types, constructor conventions, class-like structuring in C—then pivots to observability: log messages, debug tags left in place, and building around failure rather than the happy path. - **Late (~55%–85%)**: Extends into defensive practice: boundary checking (including nonsense inputs), memory-leak avoidance, and the discipline of designing for the error case first. (Excerpts thin here; specifics beyond these themes are not covered.) - **Ending (~85%–100%)**: Closes with the "design: everything you need and only what you need" principle and an object-oriented-C wrap-up, tying the individual patterns back into a single design stance. (Excerpts do not cover the final chapters in detail.) 【Key Takeaways】 - **Documentation is code-adjacent, so write it while context is fresh** (Opening): The classic "code first, document later" cycle forces authors to re-derive their own assumptions; documenting as you go preserves intent cheaply. - **Treat every artifact as documentation** (Early): Comments, diagrams, doodles, and design conversations all carry value; flowerbox comments and Doxygen-style blocks make purpose, arguments, and return types visible at the declaration site. - **Comments come in levels—use the right one** (Early): Inline notes, runtime log strings, preserved old code segments, and external design records each solve a different problem; logs double as comments that fire at runtime. - **Don't fight platform defaults** (Early): Non-standard tab widths and shell aliases make "pretty" code render chaotically elsewhere; if you need to shrink tabs to fit a line, the line is the problem. - **Names carry the design** (Middle): Vague identifiers like `thing` or `stuff` are tolerable only in tiny scopes; descriptive names cost typing time but pay back in readability and maintenance—with a caveat for security-sensitive code where internals shouldn't be obvious. - **Return types should mean something** (Middle): `void` returns erase debugging value; prefer conventions like "0 on success, non-zero on error," constructors returning a pointer or NULL, and tri-state returns for allocation routines. - **Build around failure, not success** (Middle): Happy-path code makes error handling an afterthought; restructuring as an if-else chain where success is what remains after every test fails improves error awareness and modularity. - **Logs are for good times and bad** (Middle): Emitting file/line-tagged messages to stderr—and logging successful paths too—turns a crash from a black screen into a pinpoint; debugging doesn't end at release. 【Reading Tips】 - Skim once as the author suggests, then return to chapters matching your current pain—naming, logging, or error flow—rather than reading linearly. - Deep-read the error-orientation and return-type sections; they contain the book's most transferable structural advice, even if you don't write C. - Treat the vi/editor material as optional tooling: extract the principle (keep headers and code mechanically in sync) even if you use an IDE. - Watch for C-specific idioms (malloc conventions, header files) and translate them mentally—the patterns are pitched as language-agnostic, but the examples are not. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book plus sparse late-stage markers; specific patterns in the second half (memory-leak techniques, the full object-oriented-C treatment, and the closing design chapter) are only sketched, not detailed.
Page 5
to accomplish most tasks faster and easier in any language. I strongly suggest that you skim this work once, then go back to study the details. None of these...
View in text
Page 14
YOU TO SEE YOUR COMMENTS WHEREVER THE FUNCTION IS DECLARED. Lesson: IDEs such as VI contain powerful tools while remaining minimally invasive. Learn to lever...
View in text
Excerpt 3
ust contain the name of that Employ Meaningful Return Types I don’t know how many hundreds of functions I’ve dealt with with either a void or boolean return...
View in text
Excerpt 4
ing to create log outputs to track flow through the program The problem with these patterns is that they’re unrealistic. Wedging all the functionality into t...
View in text
Excerpt 5
s. These are function definitions and error-handling paths. All of these things are Yang. Yin and Yang are One In the Eastern philosophy of the Tao (literall...
View in text
Excerpt 6
piece of marble, we go from a rough piece of code toward a refined piece of code in a series of stages. Rough Outline We usually start with a piece of pseudo...
View in text
Excerpt 7
you only need enough functions to suit the need. If you’re exposing the entire structure to the world, there was no reason to make anything private in the fi...
View in text
Excerpt 8
s programming blog at fortcollinsprogram.robert-beisert.com You can also contact him at robert@robert-beisert.com with any revisions or further observations...
View in text
Tags
AI categories
SoftwareProgramming Language
Publish Year: 2016
Language: English
Pages: 80
File Format: PDF
File Size: 4.6 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…