2 ms·
This is one of my guiding principles too. If I find myself wanting to comment the code to make it clearer or understandable, I refactor the code. The one time
by kungtotte 11y ago
This is one of my guiding principles too. If I find myself wanting to comment the code to make it clearer or understandable, I refactor the code.
The one time I let comments slide is when they document unexpected and unavoidable behavior that I can't fix in code. For example working with an inconsistent data set and having to add some convoluted code because what is a string in 95% of the rows might parse as a tuple in the remaining lines, so I need to account for that. This is so that I, or the next guy, knows why the code was written as such and won't go off trying to fix it.