Re:Google's Python style guide
by qznc on Thursday April 19, 2012 @03:10AM
(#3861786)
I like the idea to include a name with TODOs, like
This never occured to me, but it provides a good pointer whom to ask for details. On the other hand git-blame should be able to provide the same info.
[ Parent
| on HN ]
This is also convenient for when you want to pay back technical debt and fix some of the old TODOs: you can search the codebase for those with your name on them.
Seems to be a Google-ism. I haven't worked there, but all the ex-Googlers I've worked with do this. It also makes it easy to grep for all your TODOs in a tree, something you can't do with cvs/svn/git annotate.
> something you can't do with cvs/svn/git annotate.
Challenge accepted:
for i in $(git grep -l TODO); do git blame -f $i |grep TODO |grep "$NAME"; done
Granted, it can be long on a big codebase, but does the trick.If you're working with a Git repository, there's always `git blame` (http://schacon.github.com/git/git-blame.html).
Re:Google's Python style guide
by pavel_lishin on Thursday April 19, 2012 @12:33PM
(#3863813)
I prefer something like
#TODO #4001 needs more bananas
Where 4001 references something in our bug tracker (task, feature, issue, bug, etc.)I hate those. Unless you're familiar with the whole team you don't know who qznc is. Git/hg/svn blame will tell you that more precisely. Inserting your name in the comment is only slightly less annoying than people insisting to put "author"comments on top of the file (or even a function)
I guess you could use "git blame" to find the name and email of the person who added that line?
And you don't have an easy to find out who he is? Or mail him based on his username?
If his username matches with his email, or if he uses the it consistently - maybe. But probably he wrote that note ages ago, someone else rewrote the function since then and left the comment because the content is still valid - ie. you're contacting the wrong person.
In short: metadata which is not updated automatically is most likely not up to date, and may be not correct in general.