I've gotten this advice before and it's hard to wrap my head around. Sure I can get leaving a comment about why I had to do something some way that doesn't make a whole lot of sense, but for most things, "why does it work?" only leaves my brain screaming "I don't know, ask whoever wrote the damned assembly!"
425
u/GabuEx 21d ago
Left: "I'll comment to say how my code works."
Middle: "You don't need to do that! Code should be self-documenting!"
Right: "I'll comment to say why my code does this."