3 ms·
If the code doesn’t function exactly as a comment suggests how do you go about determining if the comment is wrong (or out of date) or the code?
by procinct 8y ago
If the code doesn’t function exactly as a comment suggests how do you go about determining if the comment is wrong (or out of date) or the code?
- js2 8y agoBy the expected behavior of the program? By checking the VCS commit log/blame? How would you determine what to do for a misbehaving function with no comment? This seems like a hypothetical question to which the only answer I can give is: it depends.
- cbsks 8y ago“git blame”, is what I usually reach for
- AstralStorm 8y agoIts politically correct name is git annotate. ;)
- js2 8y agoI don't think PC had anything to do with it. Git blame and annotate were added at the same time, have slightly different output, and different provenances[1,2]. The differing names are because the commands were inspired from prior VCSs that had different names for the commands. Also, from the git annotate man page[3]: The only difference between this command and git-blame is that they use slightly different output formats, and this command exists only for backward compatibility to support existing scripts, and provide a more familiar command name for people coming from other SCM systems. [1] https://github.com/git/git/commit/cbfb73d73f272f194bafa70d5be1f35abc265c79 https://github.com/git/git/commit/cbfb73d73f272f194bafa70d5b... [2] https://github.com/git/git/commit/c65e898754ef68a5520b2791890dda51753d00c6 https://github.com/git/git/commit/c65e898754ef68a5520b279189... [3]https://www.git-scm.com/docs/git-annotate https://www.git-scm.com/docs/git-annotate