I have been reading The Pragmatic Programmer and I have to say it is a fantastic book. It is full of great advice and tips for programmers. I highly recommend it to anyone who is a programmer at any level.
Lots of the advice is common sense and things I already do, but there are also lots of things I know in the back of my mind that I should be doing. So reading it has been a great reminder of those things.
Here is the complete list of tips that can be found in the book (I am reading the 20th anniversary edition, so these might be slightly different if you are looking at the original edition):
- Care About Your Craft
- Think! About Your Work
A Pragmatic Philosophy
- You Have Agency
- Provide Options, Don’t Make Lame Excuses
- Don’t Live with Broken Windows (I blogged about this in 2015)
- Be a Catalyst for Change
- Remember the Big Picture
- Make Quality a Requirements Issue
- Invest Regularly in Your Knowledge Portfolio
- Critically Analyze What You Read and Hear
- English is Just Another Programming Language
- It’s Both What You Say and the Way You Say It
- Build Documentation In, Don’t Bolt It On
A Pragmatic Approach
- Good Design Is Easier to Change Than Bad Design
- DRY - Don’t Repeat Yourself
- Make It Easy to Reuse
- Eliminate Effects Between Unrelated Things
- There Are No Final Decisions
- Forgo Following Fads
- Use Tracer Bullets to Find the Target
- Prototype to Learn
- Program Close to the Problem Domain
- Estimate to Avoid Surprises
- Iterate the Schedule with the Code
The Basic Tools
- Keep Knowledge in Plain Text
- Use the Power of Command Shells
- Achieve Editor Fluency
- Always Use Version Control
- Fix the Problem, Not the Blame
- Don’t Panic
- Failing Test Before Fixing Code
- Read the Damn Error Message
- “select” Isn’t Broken
- Don’t Assume It - Prove it
- Learn a Text Manipulation Language
Pragmatic Paranoia
- You Can’t Write Perfect Software
- Design with Contracts
- Crash Early
- Use Assertions to Prevent the Impossible
- Finish What You Start
- Act Locally
- Take Small Steps - Always
- Avoid Fortune Telling
Bend, or Break
- Decoupled Code is Easy to Change
- Tell, Don’t Ask
- Don’t Chain Method Calls
- Avoid Global Data
- If it’s Important Enough to be Global, Wrap It in an API
- Programming is About Code, But Programs Are About Data
- Don’t Hoard State; Pass It Around
- Don’t Pay Inheritance Tax
- Prefer Interfaces to Express Polymorphism
- Delegate to Services: Has-A Trumps Is-A
- Use Mixins to Share Functionality
- Parameterize Your App Using External Configuration
Concurrency
- Analyze Workflow to Improve Concurrency
- Shared State is Incorrect State
- Random Failures Are Often Concurrency Issues
- Use Actors for Concurrency Without Shared State
- Use Blackboards to Coordinate Workflow
While You Are Coding
- Listen to Your Inner Lizard
- Don’t Program by Coincidence
- Estimate the Order of Your Algorithms
- Test Your Estimates
- Refactor Early, Refactor Often
- Testing is Not About Finding Bugs
- A Test is the First User of Your Code
- Build End-to-End, Not Top-Down or Bottom-Up
- Design To Test
- Test Your Software, or Your Users Will
- Use Property-Based Tests to Validate your Assumptions
- Keep it Simple and Minimize Attack Surfaces
- Apply Security Patches Quickly
- Name well; Rename When Needed
Before the Project
- No One Knows Exactly What They Want
- Programmers Help People Understand What They Want
- Requirements are Learned in a Feedback Loop
- Work with a User to Think Like a User
- Policy is Metadata
- Use a Project Glossary
- Don’t Think Outside the Box - Find the Box
- Don’t Go into the Code Alone
- Agile is Not a Noun; Agile is How You Do Things
Pragmatic Projects
- Maintain Small, Stable Teams
- Schedule It to Make it Happen
- Organize Fully Functional Teams
- Do What Works, Not What’s Fashionable
- Deliver When Users Need It
- Use Version Control to Drive Builds, Tests and Releases
- Test Early, Test Often, Test Automatically
- Coding Ain’t Done ‘Til All the Tests Run
- Use Saboteurs to Test Your Testing
- Test State Coverage, Not Code Coverage
- Find Bugs Once
- Don’t use Manual Procedures
- Delight Users, Don’t Just Deliver Code
- Sign your Work
- First, Do No Harm
- Don’t Enable Scumbags
- It’s Your Life
Comments