| title | lessons learned in software development | ||||
|---|---|---|---|---|---|
| date | 2017-11-24 | ||||
| captured | 2017-11-24 23:39:57 UTC | ||||
| tags |
|
||||
| source | GitHub issue #340 | ||||
| aliases | |||||
| status | refined |
Henrik Warne's collection of 22 heuristics and rules of thumb accumulated over years of software development, organized into four categories: development, troubleshooting, cooperation, and miscellaneous.
Source: Lessons Learned in Software Development
- Start small, then extend. "A complex system that works is invariably found to have evolved from a simple system that worked." (John Gall)
- Change one thing at a time. Short iterations make it much easier to find problems. Commit refactoring separately from new features.
- Add logging and error handling early. Both are useful from the very beginning. As soon as something goes wrong, you need to see what is happening.
- All new lines must be executed at least once. Cheat if necessary: misspell a column name to trigger error handling, invert an if-statement to test rare paths.
- Test the parts before the whole. Well-tested parts save time when tracking down integration problems.
- Everything takes longer than you think. Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's Law."
- First understand the existing code. Reading code is as necessary a skill as writing code.
- Read and run. Use both methods to understand code. Running code reveals behavior that reading alone cannot.
- There will always be bugs. Build systems for quick troubleshooting, fixing, and deploying, not for "getting it right the first time."
- Solve trouble reports. Every developer should handle customer bugs. It reveals how the system is actually used.
- Reproduce the problem. First step always. Then verify the fix makes the problem disappear.
- Fix the known errors, then see what's left. Multiple bugs can interact and cause confusing symptoms.
- Assume no coincidences. Changed a timer and the system restarts more? Not a coincidence. Investigate.
- Correlate with timestamps. Look for even increments. A restart 3000ms after a request suggests a timer triggered it.
- Face to face has the highest bandwidth. Solutions are often much better after in-person discussion.
- Rubber ducking. Explain the problem to a colleague. You often realize the answer as you talk.
- Ask. If someone knowledgeable is available, ask. Minutes of conversation can replace days of code reading.
- Share credit. Say "Marcus came up with the idea" instead of "we tried."
- Try it. Write a little program to test how a language feature works. Fiddling around often reveals bugs.
- Sleep on it. Your subconscious works on hard problems overnight.
- Change. Don't be afraid to change roles or jobs. It is stimulating.
- Keep learning. Different languages, tools, books, courses. Small improvements compound.