A Globusz Books discovery
The Elements of Programming Style
Brian W. Kernighan, P. J. Plauger · English
Writing code isn’t just about telling a machine what to do—it’s about talking to the next poor soul who has to read it. Kernighan and Plauger’s "The Elements of Programming Style" is the grizzled veteran of programming guides, schooling us on how to write code that doesn’t make you want to pull your hair out. It’s a no-nonsense, back-to-basics manifesto for clarity in a world drowning in spaghetti code.
Globusz Books summary
What the book is about
Back in the mid-1970s, when computers were still clunky beasts and programming languages were less forgiving, Brian Kernighan and P. J. Plauger hammered out a simple truth: code should be clear, readable, and maintainable. "The Elements of Programming Style" is their attempt to turn programming from an arcane ritual into a craft anyone could respect. This book isn’t about flashy algorithms or the latest language features—it's about the timeless art of writing code that humans can understand without a decoder ring.
The authors borrow from the world of writing style guides—think Strunk and White’s "The Elements of Style"—and apply those principles to programming. The result is a collection of practical advice, illustrated with real examples from the era’s programming textbooks and their own work. The examples are mostly in older languages like Fortran and PL/I, which might feel like archaeology to modern readers. Still, the lessons shine through: clarity beats cleverness, and simplicity trumps complexity.
At its core, the book preaches that code isn’t just for computers; it’s for people. That means choosing meaningful variable names, avoiding unnecessarily convoluted control structures, and using library functions instead of reinventing the wheel. Kernighan and Plauger argue that using well-tested library routines not only saves time but also reduces bugs—good luck arguing with that in any era.
One of the biggest battles the book fights is against the notorious GOTO statement, a relic that led to tangled, unreadable code. The authors champion structured programming as a way to make code flow logically and predictably, which helps prevent the dreaded "spaghetti code" syndrome. This was a fresh perspective back then and helped push programming towards modern standards.
Documentation also gets its due. The authors stress that comments should clarify, not clutter. Redundant comments that just repeat what the code obviously does are a waste of time. Instead, comments should explain why the code does something or provide context not obvious from the code itself.
The book wraps each chapter with pithy maxims that feel like the programming equivalent of "less is more." These short nuggets pack a punch, reminding programmers that style isn’t about rules for rules’ sake but about making code easier to read, debug, and maintain.
Of course, the book isn’t without its quirks. Its focus on procedural languages and examples from the 1970s means some advice feels a bit dated, especially for those deep into object-oriented or functional programming. Modern languages and paradigms have introduced new style concerns that Kernighan and Plauger couldn’t have anticipated. Still, the fundamental ideas about clarity, simplicity, and readability remain solid ground.
For anyone who’s ever stared at a block of inscrutable code and wondered why it has to be so painful to understand, this book offers a refreshing dose of common sense. It’s less about flashy tricks and more about the steady craft of writing code that won’t haunt you or your teammates down the line. In a world where "write once, read never" still happens far too often, "The Elements of Programming Style" is a reminder that good style is a form of respect—for your code and the humans who live with it.
Beyond the summary
What might this book awaken in you?
Writing code isn’t just about making machines obedient; it’s about being decent to the humans who inherit your work. Kernighan and Plauger’s book is a blunt reminder that style matters—not for vanity, but for survival in the jungle of software maintenance. It’s not a flashy read, but it’s one that quietly saves your sanity.
Before you commit
Why you might read this
Writing code isn’t just about telling a machine what to do—it’s about talking to the next poor soul who has to read it. Kernighan and Plauger’s "The Elements of Programming Style" is the grizzled veteran of programming guides, schooling us on how to write code that doesn’t make you want to pull your hair out. It’s a no-nonsense, back-to-basics manifesto for clarity in a world drowning in spaghetti code.
Themes worth noticing
Clarity Over Cleverness
The book champions straightforward, understandable code rather than complex, mind-bending tricks.
Maintainability as a Priority
Code isn’t just for now—it’s for later. Writing with future readers in mind is a recurring theme.
Respect for Existing Tools
Leveraging library functions is a form of humility and efficiency, avoiding unnecessary reinvention.
Structured Programming Discipline
Rejecting chaotic jumps in flow control in favor of predictable, structured constructs.
Purposeful Documentation
Comments should add insight, not noise.
Key ideas, explained
Code is for Humans, Not Just Machines
The central argument is that programming isn’t just about making computers work—it’s about making your code understandable to other programmers (and your future self). Clear, readable code reduces errors and maintenance headaches.
Simplicity and Clarity Trump Cleverness
Avoid overcomplicating your code with fancy tricks or convoluted logic. The book champions straightforward solutions that anyone can follow over clever hacks that only the author understands.
Use Existing Library Functions Whenever Possible
Reinventing the wheel is a classic waste of time and invites bugs. The authors push programmers to rely on well-tested library routines to improve reliability and save effort.
Structured Programming Beats GOTO Chaos
The book takes a firm stance against GOTO statements, promoting structured control flows like loops and conditionals that make code flow clear and predictable.
Comments Should Explain Why, Not What
Good documentation complements code by explaining the reasoning behind it, not restating obvious operations. Comments should add value, not clutter.
How to Use This Book in Real Life
Name Variables Meaningfully
Pick variable names that describe their purpose clearly. This small step saves hours of head-scratching later.
Favor Library Functions Over Custom Code
Before writing your own function, check if a reliable library routine exists. It’s usually better tested and more efficient.
Write Code with the Next Reader in Mind
Assume the next person reading your code is a grumpy colleague who hates you. Write code that’s easy to follow and maintain.
Avoid GOTO and Use Structured Control Flows
Stick to loops, conditionals, and functions instead of jumping around with GOTO. It makes the code’s logic easier to trace.
Use Comments to Clarify Intent, Not Mechanics
Don’t comment on every line. Focus comments on explaining why something is done or any non-obvious decisions.
What the book does especially well
- Timeless advice on clarity and simplicity that transcends programming languages and eras.
- Practical, example-driven approach that grounds abstract principles in real code.
- Influential in shaping programming style discussions and education over decades.
- Clear focus on maintainability and readability, which remain critical in software development.
Where the book gets shaky
- Examples rely heavily on outdated procedural languages like Fortran and PL/I, which may alienate modern readers.
- Doesn’t address modern paradigms like object-oriented or functional programming directly.
- Some recommendations feel less relevant with today’s advanced tooling, IDEs, and language features.
- The style maxims can sometimes oversimplify complex trade-offs in real-world programming.
Questions to carry with you
- Is my code clear enough for the next person (or my future self) to understand quickly?
- Am I using existing tools and libraries instead of reinventing the wheel?
- Does my code flow logically, or am I relying on confusing jumps and hacks?
- Do my comments explain why the code exists, rather than what it does?
- Am I prioritizing simplicity over cleverness in my solutions?
The bottom line
Writing code isn’t just about making machines obedient; it’s about being decent to the humans who inherit your work. Kernighan and Plauger’s book is a blunt reminder that style matters—not for vanity, but for survival in the jungle of software maintenance. It’s not a flashy read, but it’s one that quietly saves your sanity.
Reader feedback
Was this summary useful?
Rate the Globusz summary of The Elements of Programming Style, not the book itself.
Loading reader ratings…
Where to go next
Don’t just read the nearest look-alike.
These recommendations serve different purposes: stay with the author, follow the closest idea, find an easier entry, go deeper, or deliberately change perspective.
Strong overlap in themes, life-impact signals, mood, or the questions the books raise.
Programming isn’t just banging out lines of code until something works. Jon Bentley’s "Programming Pearls" throws you right into the gritty reality that good programming is about crafting clever, efficient solutions—pearls, if you will—out of messy problems. This book doesn’t hand you magic spells or trendy frameworks; it forces you to think like a problem solver, not a code monkey.Read this summary →Also worth exploringThe Pragmatic Programmer: Your Journey to MasteryAndrew Hunt, David ThomasRelated through the themes, questions, or life-impact signals surrounding this book.
Software development is messy and never as neat as your textbooks promise. Hunt and Thomas don’t sell you fairy tales about flawless code or instant mastery. Instead, they hand you a toolbox of gritty, no-nonsense strategies that help you navigate the chaos and actually get stuff done—without losing your mind or your dignity.Read this summary →Also worth exploringDeep LearningIan GoodfellowRelated through the themes, questions, or life-impact signals surrounding this book.
Deep learning isn’t magic, but it sure looks like it when your phone suddenly understands your voice or your streaming app nails your taste. Ian Goodfellow and his coauthors don’t promise miracles—they hand you the nuts and bolts behind the curtain. This book is where the hype meets the hard math, practical tricks, and the real headaches of teaching machines to learn.Read this summary →Also worth exploringThe 22 Immutable Laws of Marketing: Violate Them at Your Own Risk!Al Ries & Jack TroutRelated through the themes, questions, or life-impact signals surrounding this book.
The 22 Immutable Laws of Marketing lays down 22 strict rules that brands ignore at their own peril. It’s not about flashy campaigns or luck—marketing success hinges on being first, owning a niche, and controlling perception. Think you can rewrite these laws? Good luck with that.Read this summary →Also worth exploringStucture and Interpretation of Computer ProgramsHarold Abelson, Gerald Jay SussmanRelated through the themes, questions, or life-impact signals surrounding this book.
Structure and Interpretation of Computer Programs isn’t just a programming book—it’s a deep dive into the very essence of coding and abstraction. It challenges you to understand what makes programs tick, beyond syntax and shortcuts. Ready for a mental workout that separates coders who follow recipes from those who invent them?Read this summary →Technology relevance
Still relevant in 2026: Yes — foundational
Offers timeless advice on programming practices.
Topics: Programming Practices · Software Development · Coding Standards · Computer Science
Continue the journey
Read the original when you are ready.
The full text offers a rich trove of concrete examples that illustrate what good and bad code look like in practice. It’s not just theory; it’s a hands-on guide showing you how tiny changes in style can drastically improve readability and reliability. Plus, the authors’ straightforward, no-fluff tone keeps you grounded in real-world programming rather than abstract ideals. Reading the whole book is like sitting down with a seasoned programmer who’s seen the horrors of messy code and wants to save you from the same fate.