2 ms·
> If you have to write a comment that isn't a docstring, it should probably be refactored. Yikes. Can't read past that.
by jdeaton 5y ago
> If you have to write a comment that isn't a docstring, it should probably be refactored.
Yikes. Can't read past that.
- danuker 5y agoInstead of a comment informing a user how something works (or how something does not work), write a test demonstrating and documenting its use. The test will not forget, and has a docstring explaining what and why. But crucially, it is automated, and does not rely on mistake-prone humans to check (as is the case of a comment).