Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword or section
Like this

Table Of Contents

Toward Good Code
Assume the Worst
What Is Defensive Programming?
The Big, Bad World
Techniques for Defensive Programming
See Also
Get Thinking
Mull It Over
Getting Personal
The Layout and Presentation of Source Code
What’s the Big Deal?
Know Your Audience
What Is Good Presentation?
Brace Yourself
K&R Brace Style
Exdented Brace Style
Indented Brace Style
Other Brace Styles
One Style to Rule Them All
House Styles (and Where to Stick Them)
Setting the Standard
Righteous Wars?
Why Should We Name Well?
What Do We Name?
Name Games
Technically Correct
The Nuts and Bolts
Naming Variables
Naming Functions
Naming Types
Naming Namespaces
Naming Macros
Naming Files
A Rose by Any Other Name
Be consistent
Be Consistent
Exploit Context
Use Names to Your Advantage
Self-Documenting Code
Techniques for Self-Documenting Code
Write Simple Code with Good Presentation
Choose Meaningful Names
Decompose into Atomic Functions
Choose Descriptive Types
Name Constants
Emphasize Important Code
Group-Related Information
Provide a File Header
Handle Errors Appropriately
Write Meaningful Comments
Practical Self-Documentation Methodologies
Literate Programming
Documentation Tools
How to Write Code Comments
What Is a Code Comment?
What Do Comments Look Like?
How Many Comments?
What Goes Inside Our Comments?
Explain Why, Not How
Don’t Describe the Code
Don’t Replace Code
Keep It Useful
Avoid Distractions
In Practice
A Comment on Aesthetics
Clear Block Comments
Indenting Comments
End-of-Line Comments
Helping You to Read the Code
Choose a Low-Maintenance Style
File Header Comments
Working with Comments
Helping You to Write Routines
Bug-Fix Notices
Comment Rot
Maintenance and the Inane Comment
Dealing with the Inevitable— Error Conditions in Code
From Whence It Came
Error-Reporting Mechanisms
No Reporting
Return Values
Error Status Variables
Detecting Errors
Handling Errors
When to Deal with Errors
Possible Reactions
Code Implications
Raising Hell
Managing Errors
Using Tools to Construct Software
What Is a Software Tool?
Why Worry About Tools?
Power Tools
Understand What It Can Do
Learn How to Drive it
Know What Tasks It’s Good For
Check That It’s Working
Have a Clear Route to Find Out More
Find Out When New Versions Appear
Which Tools?
Source Editing Tools
Code Construction Tools
Debugging and Investigative Tools
Language Support Tools
Miscellaneous Tools
The Black Art of Testing Code
Reality Check
Who, What, When, and Why?
Why We Test
Who Tests
What Testing Involves
When We Test
Testing Isn’t Hard . .
The Types of Test
Choosing Unit Test Cases
Design for Test
Look! No Hands!
The Face of Failure
Can You Manage It?
Fault-Tracking System
Bug Reviews
The High Road
Bug Hunting
Compile-Time Errors
Run-Time Errors
How to Fix Faults
Wasp Spray, Slug Repellent, Fly Paper . .
Memory Access Validator
System Call Tracing
Core Dump
Mechanisms to Turn Source Code into Executable Code
Language Barriers
Interpreted Languages
Compiled Languages
Byte-Compiled Languages
Making Mountains out of Molehills
Building Builds
What Makes a Good Build System?
Repeatable and Reliable
Coping with Errors
The Mechanics
Choice of Targets
Automated Builds
Build Configuration
Recursive Make
Please Release Me
Jack-of-All-Trades, Buildmaster Of?
Optimizing Programs and Writing Efficient Code
What Is Optimization?
What Makes Code Suboptimal?
Why Not Optimize?
Why Optimize?
Prove You Need to Optimize
Identify the Slowest Code
Testing the Code
Optimizing the Code
After Optimization
Optimization Techniques
Design Changes
Code Changes
Writing Efficient Code
Writing Secure Programs
The Risks
The Opposition
Excuses, Excuses
Feeling Vulnerable
Insecure Design and Architecture
Buffer Overrun
Embedded Query Strings
Race Conditions
Integer Overflow
Protection Racket
System Installation Techniques
Software Design Techniques
Code Implementation Techniques
Procedural Techniques
How to Produce Good Software Designs
Programming as Design
What Do We Design?
What’s All the Fuss About?
Good Software Design
Good Interfaces
Avoid Duplication
How to Design Code
Design Methods and Processes
Design Tools
Laying the Foundations of Software Design
What Is Software Architecture?
Software Blueprints
Points of View
Where and When Do You Do It?
What Is It Used For?
Of Components and Connections
What Is Good Architecture?
Architectural Styles
No Architecture
Layered Architecture
Pipe and Filter Architecture
Client/Server Architecture
Component-Based Architecture
Software Rot
The Warning Signs
How Does Code Grow?
Believe the Impossible
What Can We Do About This?
Writing New Code
Maintenance of Existing Code
Fostering the Correct Attitude and Approach to Programming
Monkey Business
The Eager Coder
The Code Monkey
The Guru
The Demiguru
The Arrogant Genius
The Cowboy
The Planner
The Old Timer
The Zealot
The Monocultured Programmer
The Slacker
The Reluctant Team Leader
The Ideal Programmer
So What?
The Stupidest of Men
Action Sheet
Teamwork and the Individual Programmer
Our Teams—The Big Picture
Team Organization
Management Approach
Division of Responsibility
Organization and Code Structure
Teamwork Tools
Team Diseases
Tower of Babel
Development Democracy
Satellite Station
The Grand Canyon
Personal Skills and Characteristics for Good Teamwork
Dealing with Conflict
Learning and Adaptability
Know Your Limitations
Teamwork Principles
Collective Code Ownership
Respect Other People’s Code
Code Guidelines
Define Success
Define Responsibility
Avoid Burnout
The Team Life Cycle
Team Creation
Team Growth
Team Closure
Source Control and Self-Control
Our Responsibility
Source Control
Revision Control
Access Control
Working with the Repository
Leave Branching to the Trees
A Brief History of Source Control
Configuration Management
Releasing Source Code
Wherever I Lay My Source
Writing Software Specifications
What Are They, Specifically?
The Types of Specification
Requirements Specification
Functional Specification
System Architecture Specification
User Interface Specification
Design Specification
Test Specification
What Should Specifications Contain?
The Specification-Writing Process
Why Don’t We Write Specifications?
What Is a Code Review?
When Do You Review?
The Black Art of Software Timescale Estimation
A Stab in the Dark
Why Is Estimation So Hard?
Under Pressure
Practical Ways to Estimate
The Planning Game
Keep Up!
Programming Styles
Structured Programming
Object-Oriented Programming
Functional Programming
Logic Programming
Recipes: The How and the What
Development Processes
Ad Hoc
Waterfall Model
V Model
Iterative and Incremental Development
Spiral Model
Agile Methodologies
Other Development Processes
Enough, Already!
Pick a Process
The Different Programming Disciplines
Applications Programming
Shrink-Wrap Software
Custom Applications
Games Programming
Systems Programming
Embedded Programming
Distributed Programming
Web Application Programming
Enterprise Programming
Numerical Programming
All’s Well That Ends Well
But What Now?
Chapter 1: On the Defensive
Chapter 2: The Best Laid Plans
Chapter 3: What’s in a Name?
Chapter 4: The Write Stuff
Chapter 5: A Passing Comment
Chapter 6: To Err Is Human
Chapter 7: The Programmer’s Toolbox
Chapter 8: Testing Times
Chapter 9: Finding Fault
Chapter 10: The Code That Jack Built
Chapter 11: The Need for Speed
Chapter 12: An Insecurity Complex
Chapter 13: Grand Designs
Chapter 14: Software Architecture
Chapter 15: Software Evolution or Software Revolution?
Chapter 16: Code Monkeys
Chapter 17: Together We Stand
Chapter 18: Practicing Safe Source
Chatper 19: Being Specific
Chapter 20: A Review to a Kill
Chapter 21: How Long Is a Piece of String?
Chapter 22: Recipe for a Program
Chapter 23: The Outer Limits
0 of .
Results for:
No results containing your search query
P. 1
Code Craft - The Practice of Writing Excellent Code

Code Craft - The Practice of Writing Excellent Code

|Views: 118|Likes:
Published by alphexx

More info:

Published by: alphexx on May 11, 2011
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





You're Reading a Free Preview
Pages 13 to 26 are not shown in this preview.
You're Reading a Free Preview
Pages 39 to 45 are not shown in this preview.
You're Reading a Free Preview
Pages 58 to 186 are not shown in this preview.
You're Reading a Free Preview
Pages 199 to 424 are not shown in this preview.
You're Reading a Free Preview
Pages 437 to 617 are not shown in this preview.

Activity (4)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
arpit000 liked this
BrusPulverHest liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->