3 ms·
> * unit tests are superb documentary as every dev can see how it is used and how it works at runtime. Those unit tests have to be derived from somewhere, thou
by dognotdog 5y ago
> * unit tests are superb documentary as every dev can see how it is used and how it works at runtime.
Those unit tests have to be derived from somewhere, though, right? Hopefully, there are requirements docs -- but often those are too high-level, or omit details that were discovered during implementation, and in those cases I'm very appreciative of comments describing intent and purpose of a code snippet or function. Of course, like all things, comments rot without active maintenance and refactoring.
In a perfect world, code comments would be redundant, but they do provide a very low-friction way of documenting interesting bits while writing the code, while it takes a lot more effort to back-port information into requirements documentation.