Instead of documenting within the code, many developers choose to use source code management tools, such as GitHub or Microsoft DevOps.
Tools such as these allow you to create change requests and connect changed code to these requests. Once the change is validated, it is connected to the documentation, automatically creating a knowledge database outside of the source code. This keeps the source code clean and readable.