Contents
Acknowledgements
Preface
PART 1 : BASICS
CHAPTER 1 : Standards
1.1 Standards 1.2 Guidelines
1.3 What are standards for? 1.4 What are coding standards for?
1.5 Who are coding standards for?
1.6 Coding standards vs. programming standards
1.7 Using this book
1.8 Summary
CHAPTER 2 : Psychological Factors
2.1 Pattern Recognition
2.2 Filtering
2.3 Habit
2.4 Redundancy
2.5 Cues and Context
2.6 Recognizing Basic features
2.7 Short Term, Working and Long Term memory
2.8 Chunking
2.9 The Rule of Seven
2.10 Context Switching
2.11 Modifying the image
2.12 Memorizing sounds
2.13 Eye focus
2.14 Eye movement
2.15 Looking ahead
2.16 Looking back
2.17 The subconscious is always right
2.18 Natural ambition
2.19 Summary
CHAPTER 3 : General Principles
3.1 Keywords
3.2 Think of the reader
3.3 Keep it simple
3.4 Be explicit
3.5 Be consistent
3.6 Minimize scope
3.7 There's no one true style
3.8 A standard which isn't used, isn't a standard
3.9 Distinguish between standards and guidelines
3.10 Standards don't guarantee good coding
3.11 Decide on your portability quotient
3.12 Standards are a function of their audience
3.13 Keep project standards
3.14 Use standard libraries
3.15 Utilize available tools
3.16 Summary
PART 2 : COMMENTING AND NAMING
CHAPTER 4 : Commenting 4.1 Commenting fundamentals
4.2 Comment types 4.3 Header comments
4.4 File Header comment 4.5
Function header comments 4.6 Block comments
4.7 Trailing comments 4.8 Commenting data
4.9 The preprocessor and comments
4.10 Summary
CHAPTER 5 : Naming
5.1 Constraints upon naming
5.2 Abbreviations
5.3 Short names
5.4 Separating words
5.5 Spelling of names
5.6 Naming functions
5.7 Indicating functional group
5.8 Naming variables
5.9 Indicating type
5.10 Naming replacement items
5.11 Naming Files and Directories
5.12 Summary
PART 3 : LAYOUT
CHAPTER 6 : Code Layout
6.1 Basic principles of code layout
6.2 Use of Spaces
6.3 Use of blank lines
6.4 Use vertical alignment
6.5 Indentation level
6.6 Line wrapping
6.7 Braces
6.8 Use of parentheses
6.9 Nested single statement
6.10 Empty statements
6.11 'else..if'
6.12 'switch' statements
6.13 'do..while'
6.14 Labels
6.15 Data declarations
6.16 Function declaration
6.17 Preprocessor commands
6.18 Summary
CHAPTER 7 : File Layout
7.1 Layout of directories
7.2 Division of files
7.3 Considerations for File Layout
7.4 Header files
7.5 Layout of Data files
7.6 Layout of Code files
7.7 Summary
PART 4 : USAGE
CHAPTER 8 : Language Usage
8.1 General principles of language usage
8.2 Using expressions
8.3 Using 'if'
8.4 Using 'while'
8.5 Using 'for'
8.6 Using 'do'
8.7 Using 'switch'
8.8 Using 'goto'
8.9 Using 'continue' and 'break'
8.10 Using 'return'
8.11 Using functions
8.12 Using '#define'
8.13 Conditional compilation
8.14 Other preprocessor commands
8.15 Summary
CHAPTER 9 : Data Usage
9.1 Declarations
9.2 Using floating point numbers
9.3 Using 'typedef'
9.4 Using global data
9.5 Using Structures
9.6 Using Unions
9.7 Using Arrays
9.8 Using Pointers
9.9 Using bit structures
9.10 Using Constants
9.11 Using 'static' declarations
9.12 Initializing variables
9.13 Summary
CHAPTER 10 : Programming Usage
10.1 Elegant programming
10.2 Performance programming
10.3 Defensive programming
10.4 Error handling
10.5 Diagnostics
10.6 Integrity and Recovery
10.7 Testability
10.8 Portability
10.9 Localization
10.10 Usability
10.11 Summary
PART 5 : IMPLEMENTATION
CHAPTER 11 : Implementing Standards
11.1 Raising awareness of the need for standards
11.2 'Disadvantages' of coding standards
11.3 Getting the standards defined
11.4 What should the standards contain?
11.5 Getting the standards into use
11.6 Prove the value
11.7 Keeping the standards alive
11.8 Making sure the standards are used
11.9 Summary
APPENDIX A : Example Standard
APPENDIX B : References
APPENDIX C : Glossary
x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x x x x x
|