Be open for extension, closed for modification.
software entities (classes, modules, functions, etc.) should be open for extension, but closed for modificationBertrand Meyer. 1988
Design your documentation in such a way that you do not need to add information to existing documents if a new document is added. This does not imply that every modification is bad. But if there are two solutions to a problem, prefer the one that does not touch existing documents.
The following practices are related to this principle.
The following principles are related to this principle.
- DRY Principle
- Redundant information is hard to maintain, keeping it in-sync. Therefore strive for reducing redundancy by defining one authoritative location for each piece of information.
- KISS Principle
- Keep your documentation simple. Assume that authors have relevant information for the project in their mind, but not necessarily the skills and resources to communicate it. Therefore make it very simply and joyful for them to share their expertise.
- Law of Demeter
- Documents should not reference details in other documents that may change without notice.
- Principle of least Astonishment
- Documentation should appear to the reader as being written by one single person. Uniformity reduces the chance of astonishment. The principles applies to all areas of documentation, including style and organization.
- Self Documentation Principle
- There should either be no need for additional documentation for an artifact or that documentation should be as close as possible to the artifact. This make it more probable that the documentation changes with the artifact and therefore keeps up-to-date.
- Separation of Concerns
- Reduce the amount of documents with overlapping information. Also divide the concerns regarding the formatting and - as far as possible - the structure from the content. Whenever there are different aspects, consider if handling them independently would make things easier.
- Single Responsibility Principle
- A document should focus to answer one question. This way documents can be more easily reused and combined.
- Stable Dependencies Principle
- A document should only reference documents that are not less stable than itself.
- YAGNI Principle
- Assume that an information is not needed to be written down unless proven otherwise.
More information on this principle.