Sustainable Software Engineering
Most code is read far more often than it is written. Write for the reader.
Practices That Last
- Clear naming: a function called
calculateTotalneeds no comment - Small functions: do one thing, do it well
- Fewer dependencies: every dependency is a risk of breakage
- Tests as documentation: tests describe what the code should do
The best legacy code is the code that is easy to change because it was written with the next developer in mind. That developer is often you, six months from now, having forgotten everything.