1. Program Repair Shop
2. What is This Class About?
3. A Brief Note About 'Conciseness'
4. Counting Lines
8. Counting Lines of Code: Rules
9. Introduction: Families of Variables
10. Families of Variables
14. Section 1: Merging Reports
15. Two-Headed Monster
16. Families of Variables
17. Digression about Directory Names
18. Families of Variables
19. 7 lines become 5
20. [G[Make Relationships Explicit]G]
21. Comments
22. [G[Make Relationships Explicit]G]
23. GrabFileList
25. Families of Variables
26. CopyFiles
28. Concatenation
29. CopyFiles
38. Parameter Passing
39. CopyFiles
41. CreateInput
45. CreateOutputDir
46. Unnecessary Variables
47. CreateOutputDir
48. Diagnostics
49. Structure vs. Function
50. CreateOutputDir
51. [G[Minimize Structure]G]
52. FindLastOut
55. GetPadString
56. The Cardinal Rule of Computer Programming
57. Repeated Code is a Mistake
63. Repeated Code
64. GetPadString
65. Reminder
66. GetPadString
67. We're Finished!
68. On Design
69. Section 2: Directory Copying
70. Indentation
71. Boolean Values
73. Precedence Problem
74. Global Variables
75. Function Arguments
77. Dirhandles
78. Repeated Tests
79. Try it Both Ways
80. Error Messages
83. Botched Recursion
84. Function Conception
85. Main Loop
86. [R[Don't take two steps forward and one step back]R]
89. Repeated Tests
91. 5 lines become 0
92. Programmers Write Too Much Code
94. Repeated Tests
95. Do What You Mean
96. [G[Say what you Mean]G]
97. [R[Leaning Toothpick Syndrome]R]
98. Temporary Variables are Temporary
99. A Note About Portability
102. Directory Copier
103. Section 3: Some Miscellaneous Red Flags
104. [R[\"]R]
106. print print print print print
107. [R[Many Very Long Strings]R]
108. [R[C-style for loop]R]
109. A Lucky Find!
110. File-Scope my Variables
111. Superstition
113. Global Lexicals
114. Excessively Decorated Comments
116. [R[C-style for Loop]R]
117. Unnecessary Variables
118. Single Scalar Variable in Quotes
119. Array Length Variables
120. Unnecessary Shell Calls
122. Shell Call Security Disaster
126. Unnecessary Shell Calls
135. Capturing the same pattern repeatedly
136. Randal's Rule
137. Capturing the same pattern repeatedly
138. swswsw Problem
141. Section 4: A CGI Program
142. File-Scope my Variables
143. Use Smaller Scope
144. Repeated Data Structure
145. Try it Both Ways
147. Repeated Data Structure
150. Avoid Special Cases
152. Repeated Code
153. Special Cases
154. Digression: Code and Data Structure Should be in Harmony
157. Unnecessary Subroutine
159. Repeated Code
161. Special Values
162. [G[Don't confuse internal and external representations of data]G]
164. Repeated Code
165. print_table
167. Tools
168. print_table
171. evaluate_board
173. Let's Not Be Doctrinaire
174. Try it Both Ways
175. Uniform Data Representations
176. get_computer_choice
178. Pause
179. Higher-Order Functions
185. Section 5: System Administration
186. Indentation
187. Loop Hoisting
188. Pattern Matching
189. $#array
190. Typical uses of $#array
193. $#array
194. Boolean Context
196. Special Cases
198. [R[Variable use immediately follows assignment]R]
199. The Result
200. Section 6: if and else
201. Empty if or else blocks
205. else / if
207. The Condition that Ate Michigan
209. The Condition that Ate Michigan (Digression)
210. if () { while () { if () { if () { while () { if () { ... } } } } } }
211. The Condition that Ate Michigan (Digression)
212. Unbalanced if-else Blocks
215. unless-else
216. Minimum
217. Section 7: Generating Reports
218. Families of Variable Names
223. Automatic Testing
225. [R[Making Two Passes]R]
227. Preprocessing
229. Maintenance Dilemmas
230. Preprocessing
231. [G[Avoid Special Cases]G]
232. [R[Arbitrary Numeric Constants]R]
233. [G[Avoid Special Cases]G]
234. Flags
237. [G[Try it Both Ways]G]
238. Punctuation
239. [G[Avoid Excess Punctuation]G]
240. The Condition that Ate Michigan
242. Extraction
243. cleanup
246. [G[Try it Both Ways]G]
249. Main Loop Finished
250. Missing Element 0
252. Repeated Code
253. printout
254. [R[Making Two Passes]R]
255. [G[Say What You Mean]G]
256. [G[Avoid Special Cases]G]
257. The Maintenance Programmer
258. [R[C-Style for Loops]R]
259. elsif
262. Special Cases
264. printout
272. Generating Reports
273. KLOC
274. What to Remember
275. Thank You
276. Bibliography
278. Section 8: Residue of the Red Flags
279. Families of Variables
281. Compound Compound Compound Statements
282. Anecdote About Superstition
283. Try it Both Ways
285. Avoid Special Cases
286. Store Related Values Together
291. Avoid Families of Variable Names
292. [R[Don't take two steps forward and one step back]R]
295. [G[Avoid Special Cases]G]
299. What About Matt Wright?