前言(新增批注共1条)
Chapter 1: Style(新增批注共46条) xii1
1.1 Names 3
1.2 Expressions and Statements 7
1.3 Consistency and Idioms 13
1.4 Function Macros 21
1.5 Magic Numbers 23
1.6 Comments 28
1.7 Why Bother? 35
Chapter 2: Algorithms and Data Structures(新增批注共29条)
37
2.1 Searching 38
2.2 Sorting 41
2.3 Libraries 44
2.4 A Java Quicksort 48
2.5 O-Notation 52
2.6 Growing Arrays 54
2.7 Lists 57
2.8 Trees 64
2.9 Hash Tables 70
2.10 Summary 74
Chapter 3: Design and Implementation(新增批注共12条)
76
3.1 The Markov Chain Algorithm 77
3.2 Data Structure Alternatives 79
3.3 Building the Data Structure in C 81
3.4 Generating Output 85
3.5 Java 89
3.6 C++ 93
3.7 Awk andPerl 97
3.8 Performance 99
3.9 Lessons 101Chapter 4: Interfaces(新增批注共20条) 104
4.1 Comma-Separated Values 105
4.2 A Prototype Library 107
4.3 A Library for Others 111
4.4 A C++ Implementation 121
4.5 Interface Principles 126
4.6 Resource Management 130
4.7 Abort, Retry, Fail? 135
4.8 User Interfaces 140Chapter 5: Debugging(新增批注共28条) 144
5.1 Debuggers 146
5.2 Good Clues, Easy Bugs 148
5.3 No Clues, Hard Bugs 153
5.4 Last Resorts 160
5.5 Non-reproducible Bugs 164
5.6 Debugging Tools 166
5.7 Other People’s Bugs 169
5.8 Summary 171
Chapter 6: Testing(新增批注共28条) 173
6.1 Test as You Write the Code 174
6.2 Systematic Testing 181
6.3 Test Automation 186
6.4 Test Scaffolds 189
6.5 Stress Tests 193
6.6 Tips for Testing 197
6.7 Who Does the Testing? 199
6.8 Testing the Markov Program 200
6.9 Summary 202
Chapter 7: Performance(新增批注共30条) 204
7.1 A Bottleneck 205
7.2 Timing and Profiling
211
7.3 Strategies for Speed 217
7.4 Tuning the Code 221
7.5 Space Efficiency 228
7.6 Estimation 231
7.7 Summary 234Chapter 8: Portability(新增批注共30条) 236
8.1 Language 237
8.2 Headers and Libraries 245
8.3 Program Organization 247
8.4 Isolation 252
8.5 Data Exchange 254
8.6 Byte Order 256
8.7 Portability and Upgrade 259
8.8 Internationalization 262
8.9 Summary 266Chapter 9: Notation(新增批注共13条) 269
9.1 Formatting Data 270
9.2 Regular Expressions 278
9.3 Programmable Tools 286
9.4 Interpreters, Compilers, and Virtual Machines 289
9.5 Programs that Write Programs 296
9.6 Using Macros to Generate Code 300
9.7 Compiling on the Fly 301Epilogue
308
Appendix: Collected Rules 311
Index 315