Comment of the Day: Me

March 26th, 2009

The Spacewalk team doesn’t seem fond of the @author tag on its Java classes. I’ve heard the mentality before… “No one owns the code”… “Everyone should feel able to change it”… “You can find it out who wrote it from the source control system”… and so on.

The last rationale is especially funny to me, since on both projects where this argument was made, the code was moved to a new repository at one point and all history before that date was lost, including the original author.

I personally find the @author tag useful in finding out who to ask about a particular class. Thankfully, the Spacwalk team is pretty good about remembering who is an expert on what and I’ve never had an issue. So despite my objections, I’m fine with not using @author tags.

Then I come across this nugget in our codebase…

1
// /me wonders if this shouldn't be part of the query.

The /me is actually the way to emote in IRC. It is basically used to indicate you’re “doing” something rather than saying something as in a normal chat. So syntactically, I’m not confused by why the comment is phrased that way.

What I did find myself asking, out loud no less, was who the hell “me” is in this particular case.

I’m a huge fan of these sorts of inline comments as I’ve alluded to before. But one thing I forgot to mention was that I often throw my name or ID after the comment for comments that are expressing a concern or a personal belief. That way, if the code comes under review, you can ask the commenter their mentality or if the issue still applies.

Perhaps even more important is the date the comment was made. With as rapidly as things change in most projects, it’s not a surprise that a thought or comment that used to apply no longer applies. Scoping the comment to a particular time frame helps whoever stumbles upon it realize it may not still apply. It can save the next dev a lot of time wondering why a comment is saying to add something that may no longer exist.

Or, perhaps using /me is just meant as a brainwashing technique. I’m going to add a comment /me buys Professor Jay a beer to my next commit to see if it really works. And if it does, I’m enrolling my wife in my class next semester and teaching her to be a programmer.

2 Responses to “Comment of the Day: Me”


  1. Miroslav Suchý

    That is because we master git:
    $ git grep ‘me wonders if this shouldn’
    java/code/src/com/redhat/rhn/frontend/action/errata/CloneErrataAction.java: // /me wonders if this shouldn’t be part of the query.
    $ git blame java/code/src/com/redhat/rhn/frontend/action/errata/CloneErrataAction.java |grep wonders
    c9bbaca2 (Jason Dobies 2009-03-27 11:58:27 -0500 115) // /me wonders if this shouldn’t be part of the query.

    So /me == Jason Dobies


  2. Professor Jay

    Not quite… I merged the CloneErrataSetupAction and CloneErrataAction classes together and then deleted CloneErrataSetupAction. The code with the /me comment was moved from the CloneErrataSetupAction; blame says it was me since I was the one who “added” it to CloneErrataAction. The /me comment in particular had been there since the initial commit, well before I was even on the team :)

    http://git.fedorahosted.org/git/?p=spacewalk.git;a=history;f=java/code/src/com/redhat/rhn/frontend/action/errata/CloneErrataSetupAction.java;hb=46eb4b67a8790f187cfd783f35c92e42128d4fed

    http://git.fedorahosted.org/git/?p=spacewalk.git;a=blob;f=java/code/src/com/redhat/rhn/frontend/action/errata/CloneErrataSetupAction.java;hb=c43c7764d22ca8a78fd6f446b0892b6dec5e78a8