1204
Comenting code
(lemmy.ml)
Post funny things about programming here! (Or just rant about your favourite programming language.)
I often use comments as ways to say, “I know this is cursed, but here’s why the obvious solution won’t work.” Like so:
Edit: to answer your question more directly, the “why not what” advice is more about the intent of whether to write a comment or not in the first place rather than rephrasing the existing “what” style comments. What code is doing should be clear based on names of variables and functions. Why it’s doing that may be unclear, which is why you would write a comment.