News for hackers. Stuff that matters.
Re:Best practices for writing code comments by unionpivo on Friday December 24, 2021 @11:45AM (#29675064)
honestly it needs both, but if you only put it in 1 place put it in code.

During the development you are mostly likely looking at commits, or PRs, so that makes sense.

But if its long living piece of code, people will get you your code via following function/method chains or just browsing the source not commits. While you can use git blame, and then figure out the commit, and then read last few commit messages, putting comment on code is easier on everybody.

There are no comments on this comment yet.