3 ms·
I find your example actually being a counter-example. The comment should rather be at the top of the definition/implementation of is_legacy_user, so IDEs and us
by ktpsns 7y ago
I find your example actually being a counter-example. The comment should rather be at the top of the definition/implementation of is_legacy_user, so IDEs and users can read and extract it when neccessary (thinking of Javadoc/Python's docstrings). The obvious advantage is that you want to keep comment and function in sync, and not all the calling points distributed around the code. Also, your example is a counterexample because the function name should be spelling, and a comment like
/* Checks if Foo */
is_foo(...)
obviously duplicates the same information.