Always provide complete and accurate documentation for all function parameters, especially when adding new ones. Each parameter should have a clear description that explains its purpose, expected values, and behavior.
Always provide complete and accurate documentation for all function parameters, especially when adding new ones. Each parameter should have a clear description that explains its purpose, expected values, and behavior.
When adding a new parameter to an existing function:
For example, when adding a parameter like failsafe
:
/**
* \brief Allocation.
* \param handle Handle struct.
* \param failsafe Return a handle with a null dptr if out of memory, rather than exit.
*/
virtual void Alloc(Storage::Handle* handle, bool failsafe = false);
This helps other developers understand how to use the function correctly and makes the codebase more maintainable. Incomplete parameter documentation can lead to misuse of functions and introduces bugs that are difficult to diagnose.
Enter the URL of a public GitHub repository