DEV Community

Discussion on: Your approach to documentation

Collapse
 
nestedsoftware profile image
Nested Software • Edited

I generally avoid any detailed documentation inside of code (with the exception of library code meant for general consumption). I find it's better to use automated tests to explain what the code should do, and to let the code speak for itself with respect to design. In the few places where I feel a short comment may be warranted, I find it's often preferable to extract the code in question to a named function or variable instead. I do believe in properly documenting how to set things up - and to automate that as much as possible.