tl;dr:(1) Comments should not duplicate the code. (2) Good comments do not excuse unclear code. (3) If you can’t write a clear comment, there may be a problem with the code. (4) Comments should dispel confusion, not cause it. (5) Explain unidiomatic code in comments, and more. Each explained in detail.
tl;dr:Seasoned engineer who worked at Google, Microsoft and Mozilla discusses three of her most embarrassing mistakes and the valuable lessons she learned from each.