Developer documentation maintenance sometimes falls on the back burner of development projects, where time and manpower are always scarce.
When that happens, the documentation that needs to be maintained just grows and grows until it’s almost impossible to make heads or tails of it.
In addition to that, some documents can even become a hazard because they carry inaccurate or outdated information that could end up in front of the eyes of end users.
In this article, we’ll provide you with six actionable tips that will enable you to carry out the task of developer documentation maintenance faster, and with more precision.
That way, you’ll never have to worry about inaccurate, outdated, or redundant docs ever again!
Let’s start with our first tip: adequate planning.
Plan Out Your Documentation
It’s very hard to keep developer documentation up to date if it’s in a chaotic state.
By that we mean, when you’re paying too little attention to document architecture, keeping documentation in more than one place, and having no naming conventions, among other things.
Therefore, if you want documentation maintenance to even be possible, you will have to plan your projects ahead to make your life easier later.
A good way to do that is to develop documentation architecture for your project.
In other words, to plan which resources will go where (into which folders) and how the project will be divided into working units.
Here’s how Nita Beck, a seasoned developer and technical communication expert, plans her projects:
As you can see, everything related to a documentation project can be found in a single folder.
The project is divided into two parts, each with its own sub-folder that contains the same structure (Content Explorer + Project Organizer).
Another folder here contains external resources (reusable templates) that are valid for both project parts.
The folder “Naming Conventions” is found outside of the project and contains abbreviations, file and folder names that are the same for every project.
Later, as you’re maintaining the documentation, the resources that need to be changed, updated, added, or erased all have a place in easy-to-track-down folders, meaning you’ll never lose track of any document or need to handle duplicate documents.
If your documentation is planned out perfectly before the start of the project and a place for every document is envisioned and created in one place, subsequent maintenance will be much faster and more accurate.
Start by forming an architecture for all of your documents, and make sure you have your templates, naming conventions, and folders ready before you create any documents.
Write Self-Documenting Code
Here’s some simple math: the more comments you write for your code, the more documentation you will have to maintain continually.
Besides, if you feel the need to comment on your code a lot, that means the code can’t be easily understood in the first place. And that’s just not good coding practice.
This is something even the greats agree on:
A much better practice is to write self-documenting code or code that can be understood without the help of comments.
Not only will this help with maintenance, as less documentation will have to be modified and verified, but it will also help new developers who inherit the code come to grips with it and continue where the old programmer left off.
So, for example, instead of writing code that requires an extensive explanation, like this:
You can use descriptive naming conventions and language that’s easily understood by humans.
In our example, that would allow you to forego the comment in the first line, because the code itself tells you what the action does.
Here’s how that might look:
Generally speaking, there are three kinds of comments:
- Redundant comments explaining the obvious that can simply be removed
- Explanatory comments whose purpose is to aid understanding, which can be removed after the code is refactored for clarity
- Comments that are actually useful, meaning they explain the reasoning behind a piece of code
To make maintenance easier, you should only keep the last kind because it provides a layer of information that cannot be found in the code itself.
So, to clarify, we’re not suggesting that you should never write code comments.
Instead, it might be a good idea to focus on writing self-documenting code and make sure the comments really complement it in the right way.
This alone should enable you to write clearer, more usable code and make your life easier when it’s time to conduct maintenance, as you’ll have fewer comments to sift through.
Keep Documentation Close to the Code
Another principle that helps with code maintenance is keeping documentation as close as possible to the code.
That way, whenever the code changes, it will be easy enough to find the piece of documentation that refers to it and change it as well.
In practical terms, this means keeping developer documentation in the same repository as the code.
This makes it much easier to link specific lines of code to their explanation and instructions.
Also, since the code is right beside the documentation, it becomes almost impossible to lose track of it or make modifications to the wrong documentation.
Another useful practice to take note of here is writing code-coupled documentation or documentation that directly references the code.
This can mean including references such as:
- Code snippets
- Variable and path names
- Code examples
This will ensure that your documentation remains close to the source code, meaning you won’t have to search far to make changes when the code is modified.
Archbee will enable you to create documentation side by side, thanks to its multi-language code editor.
It also has the ability to automatically create code samples, making it easier than ever to write code-enriched documentation.
Your documentation is then easily published to your domain with just a couple of clicks, allowing you to create amazing developer documentation portals your users will keep revisiting as they learn to use your product.
Remember, when documentation is close to the code it explains, every time a piece of code is modified, the documentation it references can be effortlessly found and changed as well.
That makes documentation maintenance almost concurrent with the development of the code.
Document as You Code
There are lots of reasons why continuous documentation is beneficial for all subsequent maintenance.
For one, when code isn’t documented as it’s written, the task is often delegated to someone who wasn’t there when the code was created, someone who doesn’t have first-hand experience with the code and will, therefore, have more trouble creating and maintaining the documentation.
Secondly, when documentation is written outside of the coding process, it’s sometimes documented only once, meaning it can become inaccurate and obsolete as the code changes.
At that point, getting rid of the documentation and starting from scratch becomes more feasible than maintaining it.
Some developers would even go so far as to call documentation “nonliving” the moment it’s finished if there are no plans to keep working on it.
Finally, it should make sense that more complex systems are much more challenging to document.
So if you don’t document continuously, you will need to put in more time and effort to maintain bigger, more complex chunks of code.
The biggest problem here is, of course, finding the time to document in a coding project where time is always short.
This is another reason why planning is so important for documentation maintenance.
Developers and product managers should block off time for documentation (including maintenance) every week to ensure this process really is running simultaneously.
According to seasoned developers, up to an entire day dedicated to documentation every week should do the trick.
Also, if you have another look at the first Redditor’s experience with continuous documentation, you’ll see that another good practice to implement here is to pair developers or developers and technical writers to work on the code and documentation together.
That way, documentation is always created with the code and there’s an opportunity to test the documentation for usability and clarity before it’s shipped, as more than one set of eyes will see it.
All in all, continuous documentation isn’t easy to set up, but once you do, you’ll need to maintain smaller, more manageable chunks of documentation and work with enhanced accuracy and less effort.
Create an Update Schedule
If documenting alongside the coding process isn’t a feasible option, another tactic you could try is scheduling maintenance.
This will enable you to keep the workload manageable while also allowing for the documentation to stay relatively accurate and up-to-date.
A good way to approach this is to schedule documentation updates after project control events.
That includes, but is not limited to:
- After every push
- After every commit
- After every merge
This should allow you to handle maintenance before the documentation becomes too comprehensive and complex to manage with accuracy and speed, and it should also prevent you from wasting your time rereading documentation too often.
Another way to schedule maintenance is to do it at regular intervals.
Once a document sits in your repository for a certain amount of time, it’s a good idea to verify whether it’s still up-to-date or if it needs some modification.
Some advanced documentation tools have a great feature that could help you here.
Tools like Archbee have automated alarms that can alert you (or a responsible team member) that a document hasn’t been checked for a while and is now unverified.
Here’s how that looks:
Source: Archbee on YouTube
All you have to do is program the verification cycle (how often the document needs to be checked) and tag a responsible person who will verify the document, such as the author or the product owner, for example.
Update scheduling is a great way to keep the maintenance workload light while also ensuring your end users won’t have to deal with inaccurate documentation in their work.
It’s an excellent solution for keeping developer documentation fresh and relevant.
Clean Up Your Documentation
One thing you should always bear in mind is that document deletion and elimination is a perfectly normal, even beneficial part of maintenance.
When a software product is developed, the team behind it often makes pivots, changes direction, or simply abandons parts of code and entire features.
This also means that documentation is created for these aspects and then left sitting in your repository, which poses an efficiency problem.
As you maintain documentation, you’ll have to consider if a specific document is even part of the project anymore or if it can be skipped.
This wastes time, causes confusion, and can even lead to irrelevant documentation being shipped.
The better option here is to act when the decision is made to abandon parts of the project and remove or archive the documentation tied to them.
While you’re at it, you can also make it a rule that other unnecessary pieces of documentation can be removed or archived when stumbled upon.
These can include:
- Duplicate documentation, which poses a threat if one document is updated and its twin isn’t
- Personal notes or experimental files created for the use of a developer who has since moved on from the project or has no use for this resource anymore
- Broken links, bookmarks, dysfunctional pieces of code
- Obsolete topics that are no longer important for the project
The point here is that irrelevant, obsolete, or outdated documentation creates a burden when it comes to maintenance and could even put the project at risk if developers accidentally use it to do their work.
Therefore, if a document doesn’t have any bearing on what you’re currently developing, it’s okay to consider archiving it or removing it completely from your depository.
As you were able to see in this article, a big part of healthy developer documentation comes from good planning and continuous attention to your docs.
As long as you perceive documentation and its maintenance as an integral part of your development project and provide the means and tools needed for these tasks, you should have no problem keeping your documents fresh and relevant to the code.
So find the time for documentation maintenance in collaboration with your team, and ensure this important part of your project gets the focus it deserves.