4 ms·
Comment the why, not the what.
by sys_64738 7y ago
Comment the why, not the what.
- pytester 7y agoIt's good to comment the what too if it's hard to discern what it's doing from the code. There have been a number of cases where, for instance, I had to call a bizarrely named API and do something unexpected in order to get an unintuitive outcome and in that case a "what" comment isn't such a bad idea.
- tln 7y agoComment the intentions and motivations for behavior.