# Documenting

Documentation is not as fun as writing code, that's true. It is, however, when done adequately, one of the better investments you can do.

Documentation will first and foremost help you. You won’t update the entire system constantly. Some parts of code will not have any checks or updates for months. When v2 is requested you will have forgotten a lot of the shortcuts and why specific decisions have been made. You will have to rediscover them which will cost you time.

Source code level documentation is generally not recommended. High quality code is readable, contextual, and intuitive. If you write documentation inside your code, you will need to update it when changing functionality. Most developers fail to update their documentation, and you may read one thing in the comment, but the code will do something else.

There are a few types of comments in the source code that are useful in certain scenarios:

* TODOs that explain something that should be improved. Ideally, they will have a link to a ticket inside your system.
* Explanation comments as to why something is done in a specific way, for example unintuitive logic.
* Birds-eye overview of a module or set of modules.

The documentation outside of the codebase is generally of two types:

* End-user documentation that describes how to use the system, targeted at the audience who will use it.
* Technical documentation that describes how the system works, targeted at the audience who will maintain it.

One of the most significant advantages of maintaining high-quality documentation is that it helps with onboarding new team members. With thorough documentation, new developers can quickly get up to speed and start contributing to the project. This is especially important for projects with a lot of legacy code.

Examples of companies with great documentation include Amazon, which has detailed documentation for AWS, and Google, which has comprehensive developer documentation for their various platforms and tools. Another company with excellent technical documentation is Microsoft, which provides extensive resources for developers using their technologies.

Documentation is an essential aspect of software development that should not be overlooked. While it may not be as exciting as writing code, it is a crucial investment that will save you time and make it easier for you and others to understand and maintain the system.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://junior2mid.devcrisis.com/documenting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
