3 ms·
I don't understand the 11'th one can someone explain to me also the given link seems broken. > If you have to write a comment that isn't a docstring, it should
by rajasimon 5y ago
I don't understand the 11'th one can someone explain to me also the given link seems broken.
> If you have to write a comment that isn't a docstring, it should probably be refactored. Every new line of comments increases this probability. (For a more nuanced take, the Linux Kernel Documentation)
- adamnemecek 5y agoHe means that you should avoid commenting single lines but instead write comments on whole functions.
- rckrd 5y agoLink should be fixed. It's https://www.kernel.org/doc/html/v4.10/process/coding-style.html#commenting https://www.kernel.org/doc/html/v4.10/process/coding-style.h...
- tudelo 5y agoOne way that I was taught is via the HTDP "design contract". So in this case a "docstring" translates to defining the method contact (its inputs and outputs) and the purpose of the function (what the function does). https://course.ccs.neu.edu/csg107/design-recipe.html https://course.ccs.neu.edu/csg107/design-recipe.html is a random link that describes all the steps, with something like 2. being the one mentioned (I think, I'm not OP.)