2nd edition. — Redmond: Microsoft Press, 2004. — 952 p.
Further Praise for Code Complete
Contents at a Glance
Who Should Read This Book?Where Else Can You Find This Information?
Key Benefits of This Handbook
Why This Handbook Was Written
Checklists
Tables
Figures
Laying the Foundation
What Is Software Construction?
Why Is Software Construction Important?
Key Points
The Importance of Metaphors
How to Use Software Metaphors
Common Software Metaphors
Additional Resources
Key Points
Measure Twice, Cut Once Upstream Prerequisites
Importance of Prerequisites
Determine the Kind of Software You’re Working On
Problem-Definition Prerequisite
Requirements Prerequisite
Architecture Prerequisite
Amount of Time to Spend on Upstream Prerequisites
Additional Resources
Key Points
Choice of Programming Language
Your Location on the Technology Wave
Selection of Major Construction Practices
Key Points
Creating High-Quality Code
Design in Construction
Design Challenges
Key Design Concepts
Design Building Blocks Heuristics
Design Practices
Comments on Popular Methodologies
Additional Resources
Key Points
Working Classes
Class Foundations Abstract Data Types (ADTs)
Good Class Interfaces
Design and Implementation Issues
Reasons to Create a Class
Beyond Classes Packages
Additional Resources
Key Points
High-Quality Routines
Valid Reasons to Create a Routine
Design at the Routine Level
Good Routine Names
How Long Can a Routine Be?
How to Use Routine Parameters
Special Considerations in the Use of Functions
Macro Routines and Inline Routines
Key Points
Defensive Programming
Protecting Your Program from Invalid Inputs
Assertions
Error-Handling Techniques
Exceptions
Barricade Your Program to Contain the Damage Caused by Errors
Debugging Aids
Determining How Much Defensive Programming to Leave in Production Code
Being Defensive About Defensive Programming
Additional Resources
Key Points
The Pseudocode Programming Process
Summary of Steps in Building Classes and Routines
Pseudocode for Pros
Constructing Routines by Using the PPP
Alternatives to the PPP
Key Points
Variables
General Issues in Using Variables
Data Literacy
Making Variable Declarations Easy
Guidelines for Initializing Variables
Scope
Persistence
Binding Time
Relationship Between Data Types and Control Structures
Using Each Variable for Exactly One Purpose
Key Points
Considerations in Choosing Good Names
Naming Specific Types of Data
The Power of Naming Conventions
Informal Naming Conventions
Standardized Prefixes
Creating Short Names That Are Readable
Kinds of Names to Avoid
Key Points
Fundamental Data Types
Numbers in General
Integers
Floating-Point Numbers
Characters and Strings
Boolean Variables
Enumerated Types
Named Constants
Arrays
Creating Your Own Types (Type Aliasing)
Key Points
Structures
Pointers
Global Data
Additional Resources
Key Points
Statements
Statements That Must Be in a Specific Order
Statements Whose Order Doesn’t Matter
Key Points
if Statements
case Statements
Key Points
Selecting the Kind of Loop
Controlling the Loop
Creating Loops Easily — From the Inside Out
Correspondence Between Loops and Arrays
Key Points
Multiple Returns from a Routine
Recursion
goto
Additional Resources
Key Points
General Considerations in Using Table-Driven Methods
Direct Access Tables
Indexed Access Tables
Stair-Step Access Tables
Other Examples of Table Lookups
Key Points
Boolean Expressions
Compound Statements (Blocks)
Null Statements
Taming Dangerously Deep Nesting
A Programming Foundation Structured Programming
Control Structures and Complexity
Key Points
Code Improvements
Characteristics of Software Quality
Techniques for Improving Software Quality
Relative Effectiveness of Quality Techniques
When to Do Quality Assurance
The General Principle of Software Quality
Additional Resources
Key Points
Collaborative Construction
Overview of Collaborative Development Practices
Pair Programming
Formal Inspections
Other Kinds of Collaborative Development Practices
Comparison of Collaborative Construction Techniques
Additional Resources
Key Points
Developer Testing
Role of Developer Testing in Software Quality
Recommended Approach to Developer Testing
Bag of Testing Tricks
Typical Errors
Test-Support Tools
Improving Your Testing
Keeping Test Records
Additional Resources
Key Points
Overview of Debugging Issues
Finding a Defect
Fixing a Defect
Psychological Considerations in Debugging
Debugging Tools — Obvious and Not-So-Obvious
Additional Resources
Key Points
Refactoring
Kinds of Software Evolution
Introduction to Refactoring
Specific Refactorings
Refactoring Safely
Refactoring Strategies
Key Points
Code-Tuning Strategies
Performance Overview
Introduction to Code Tuning
Kinds of Fat and Molasses
Measurement
Iteration
Additional Resources
Key Points
Code-Tuning Techniques
Logic
Loops
Data Transformations
Expressions
Routines
Recoding in a Low-Level Language
The More Things Change, the More They Stay the Same
Additional Resources
Key Points
System Considerations
How Program Size Affects Construction
Communication and Size
Effect of Project Size on Errors
Effect of Project Size on Productivity
Effect of Project Size on Development Activities
Additional Resources
Key Points
Managing Construction
Encouraging Good Coding
Configuration Management
Estimating a Construction Schedule
Measurement
Treating Programmers as People
Managing Your Manager
Additional Resources on Managing Construction
Key Points
Importance of the Integration Approach
Integration Frequency — Phased or Incremental?
Incremental Integration Strategies
Daily Build and Smoke Test
Additional Resources
Key Points
Programming Tools
Source-Code Tools
Executable-Code Tools
Tool-Oriented Environments
Building Your Own Programming Tools
Tool Fantasyland
Additional Resources
Key Points
Software Craftsmanship
Layout and Style
Layout Fundamentals
Layout Techniques
Layout Styles
Laying Out Control Structures
Laying Out Individual Statements
Laying Out Comments
Laying Out Routines
Laying Out Classes
Additional Resources
Key Points
External Documentation
Programming Style as Documentation
To Comment or Not to Comment
Keys to Effective Comments
Commenting Techniques
IEEE Standards
Additional Resources
Key Points
Personal Character
Isn’t Personal Character Off the Topic?
Intelligence and Humility
Curiosity
Intellectual Honesty
Communication and Cooperation
Creativity and Discipline
Characteristics That Don’t Matter As Much As You Might Think
Habits
Additional Resources
Key Points
Conquer Complexity
Pick Your Process
Write Programs for People First, Computers Second
Program into Your Language, Not in It
Focus Your Attention with the Help of Conventions
Program in Terms of the Problem Domain
Watch for Falling Rocks
Iterate, Repeatedly, Again and Again
Thou Shalt Rend Software and Religion Asunder
Key Points
Where to Find More Information
Information About Software Construction
Topics Beyond Construction
Periodicals
A Software Developer’s Reading Plan
Joining a Professional Organization