http://www.perlmonks.org?node_id=879588


in reply to Re^5: On comments
in thread On comments

I agree with you about commenting being the exception rather than the rule. I also agree with comments being small, seldom, and to the point being helpful. I also see the advantage to sometimes using a higher-level programming language to comment a lower-level one. However, I don't see how using a higher-level language rather than English prose would help in every case.

I don't see, for example, restating the code helping someone to understand why it is important to zero-fill or zero-extend the high 32 bits of a 64-bit register when working in 32-bit mode on a hybrid 32-bit and 64-bit machine for security purposes. An explanation of why something is done really doesn't come from doing it again in a different way. When you really must explain why, explaining how does no help. Hardware vagaries and minute details of domain knowledge can be restated in many programming languages, but the reasoning behind the code is still a separate thing from the code itself.