Contents 1. A Pragmatic Philosophy 1 Topic 1. It s Your Life . . . . . . . . . . . . . . . . . . . . 2 Topic 2. The Cat Ate My Source Code . . . . . . . . . . . . 3 Topic 3. Software Entropy . . . . . . . . . . . . . . . . . . 6 Topic 4. Stone Soup and Boiled Frogs . . . . . . . . . . . . 8 Topic 5. Good-Enough Software . . . . . . . . . . . . . . 11 Topic 6. Your Knowledge Portfolio . . . . . . . . . . . . . 13 Topic 7. Communicate! . . . . . . . . . . . . . . . . . . 19 2. A Pragmatic Approach 27 Topic 8. The Essence of Good Design . . . . . . . . . . . . 28 Topic 9. DRY—The Evils of Duplication . . . . . . . . . . . 30 Topic 10. Orthogonality . . . . . . . . . . . . . . . . . . . 39 Topic 11. Reversibility . . . . . . . . . . . . . . . . . . . 47 Topic 12. Tracer Bullets . . . . . . . . . . . . . . . . . . . 50 Topic 13. Prototypes and Post-it Notes . . . . . . . . . . . . 56 Topic 14. Domain Languages . . . . . . . . . . . . . . . . 59 Topic 15. Estimating . . . . . . . . . . . . . . . . . . . . 65 3. The Basic Tools 73 Topic 16. The Power of Plain Text . . . . . . . . . . . . . . 74 Topic 17. Shell Games . . . . . . . . . . . . . . . . . . . 78 Topic 18. Power Editing . . . . . . . . . . . . . . . . . . . 81 Topic 19. Version Control . . . . . . . . . . . . . . . . . . 84 Topic 20. Debugging . . . . . . . . . . . . . . . . . . . . 88 Topic 21. Text Manipulation . . . . . . . . . . . . . . . . 97 Topic 22. Engineering Daybooks . . . . . . . . . . . . . . 100 4. Pragmatic Paranoia 103 Topic 23. Design by Contract . . . . . . . . . . . . . . . 104 Topic 24. Dead Programs Tell No Lies . . . . . . . . . . . 112 Topic 25. Assertive Programming . . . . . . . . . . . . . . 115 Topic 26. How to Balance Resources . . . . . . . . . . . . 118 Topic 27. Don t Outrun Your Headlights . . . . . . . . . . 125 5. Bend, or Break 129 Topic 28. Decoupling . . . . . . . . . . . . . . . . . . . 130 Topic 29. Juggling the Real World . . . . . . . . . . . . . 137 Topic 30. Transforming Programming . . . . . . . . . . . 147 Topic 31. Inheritance Tax . . . . . . . . . . . . . . . . . 158 Topic 32. Configuration . . . . . . . . . . . . . . . . . . 166 6. Concurrency 169 Topic 33. Breaking Temporal Coupling . . . . . . . . . . . 170 Topic 34. Shared State Is Incorrect State . . . . . . . . . . 174 Topic 35. Actors and Processes . . . . . . . . . . . . . . 181 Topic 36. Blackboards . . . . . . . . . . . . . . . . . . . 187 7. While You Are Coding 191 Topic 37. Listen to Your Lizard Brain . . . . . . . . . . . . 192 Topic 38. Programming by Coincidence . . . . . . . . . . . 197 Topic 39. Algorithm Speed . . . . . . . . . . . . . . . . . 203 Topic 40. Refactoring . . . . . . . . . . . . . . . . . . . 209 Topic 41. Test to Code . . . . . . . . . . . . . . . . . . . 214 Topic 42. Property-Based Testing . . . . . . . . . . . . . 224 Topic 43. Stay Safe Out There . . . . . . . . . . . . . . . 231 Topic 44. Naming Things . . . . . . . . . . . . . . . . . 238 8. Before the Project 243 Topic 45. The Requirements Pit . . . . . . . . . . . . . . 244 Topic 46. Solving Impossible Puzzles . . . . . . . . . . . . 252 Topic 47. Working Together . . . . . . . . . . . . . . . . 256 Topic 48. The Essence of Agility . . . . . . . . . . . . . . 259 9. Pragmatic Projects 263 Topic 49. Pragmatic Teams . . . . . . . . . . . . . . . . 264 Topic 50. Coconuts Donn t Cut It . . . . . . . . . . . . . . 270 Topic 51. Pragmatic Starter Kit . . . . . . . . . . . . . . 273 Topic 52. Delight Your Users . . . . . . . . . . . . . . . . 280 Topic 53. Pride and Prejudice . . . . . . . . . . . . . . . 282 Postface 285 Bibliography 289 Possible Answers to the Exercises 293 Index 307