Book description
This philosophy-of-programming guide presents a unique and entertaining take on how to think about programming. A collection of 21 pragmatic rules, each presented in a standalone chapter, captures the essential wisdom that every freshly minted programmer needs to know and provides thought-provoking insights for more seasoned programmers.
Author Chris Zimmerman, cofounder of the video game studio Sucker Punch Productions, teaches basic truths of programming by wrapping them in memorable aphorisms and driving them home with examples drawn from real code. This practical guide also helps managers looking for ways to train new team members.
The rules in this book include:
- As simple as possible, but no simpler
- Let your code tell its own story
- Localize complexity
- Generalization takes three examples
- Work backward from your result, not forward from your code
- The first lesson of optimization is don't optimize
- A good name is the best documentation
- Bugs are contagious
- Eliminate failure cases
- Code that isn't running doesn't work
- Sometimes you just need to hammer the nails
Publisher resources
Table of contents
- Preface
- The Story of the Rules
- How to Disagree with the Rules
- 1. As Simple as Possible, but No Simpler
- 2. Bugs Are Contagious
- 3. A Good Name Is the Best Documentation
- 4. Generalization Takes Three Examples
- 5. The First Lesson of Optimization Is Don’t Optimize
- Interlude: In Which the Previous Chapter Is Criticized
- 6. Code Reviews Are Good for Three Reasons
-
7. Eliminate Failure Cases
- A Function That Makes It Easy to Shoot Myself in the Foot
- Shooting Myself in the Foot via a Ricochet
- Enlisting the Compiler’s Aid to Avoid Shooting My Foot
- Timing Is Everything
- A More Complicated Example
- Making Ordering Mistakes Impossible
- Using Templates Instead of Method Chaining
- Coordinated Control of State
- Detecting Mistakes Is Good, but Making Them Impossible to Express Is Better
- 8. Code That Isn’t Running Doesn’t Work
- 9. Write Collapsible Code
- 10. Localize Complexity
- 11. Is It Twice as Good?
- 12. Big Teams Need Strong Conventions
- 13. Find the Pebble That Started the Avalanche
- 14. Code Comes in Four Flavors
- 15. Pull the Weeds
- 16. Work Backward from Your Result, Not Forward from Your Code
- 17. Sometimes the Bigger Problem Is Easier to Solve
- 18. Let Your Code Tell Its Own Story
-
19. Rework in Parallel
- Bumps in the Road
- Build a Parallel System Instead
- A Concrete Example
- Stack Allocation in Practice
- A Cloud on the Horizon
- Making Stack Contexts a Little Smarter
- Migrating from Old Stack Contexts to New Ones
- Preparing to Migrate StackVector
- Time to Migrate
- Recognizing When Parallel Rework Is a Good Strategy
- 20. Do the Math
- 21. Sometimes You Just Need to Hammer the Nails
- Conclusion: Making the Rules Your Own
- A. Reading C++ for Python Programmers
- B. Reading C++ for JavaScript Programmers
- Index
- About the Author
Product information
- Title: The Rules of Programming
- Author(s):
- Release date: December 2022
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781098133115
You might also like
book
The Programmer's Brain
Your brain responds in a predictable way when it encounters new or difficult tasks. This unique …
book
The Software Developer's Career Handbook
At some point in your career, you'll realize there's more to being a software engineer than …
book
The Art of Clean Code
Most software developers waste thousands of hours working with overly complex code. The eight core principles …
audiobook
The Design of Everyday Things
First, businesses discovered quality as a key competitive edge; next came science. Now, Donald A. Norman, …