开发者

What is the general rule for attributing code to a certain author

Usually many folks contribute to the an application development process (say a java / j2ee project). Sometimes a single person (say foo@bar.com) is responsible writing the code for a certain file or certain other folks might have changed the code.

Do you attribute author information on top of the file for any user who makes a modification like scen开发者_如何学Goario 2 mentioned below or just the primary author as in scenario 1? Is there a specific order in which author information should be added on a change?

/**
 * @author Foo Bar, (foo@bar.com)
 *
 */

or

/**
 * @author Foo Bar, (foo@bar.com)
 * @author Foo Foo, (foo@foo.com)
 * @author Bar Bar, (bar@bar.com)
 *
 */


Personally I don't think that authors should be listed in the code. There are several reasons for this:

  • No claims of "ownership". The code is the responsibility of everybody.
  • The source repository can accurately answer any query about who has edited the code in question all the way back to day one (and hopefully even why). No need to maintain this manually.


For in-house projects, I only tag myself if my work represents some considerable change or is the first time that class has been used for some time so my colleagues know I've worked on the class and I'm familiar with it. In my opinion, each new author should be added in order to the list.

In our company, it really comes down to the individual engineer, we don't have guidelines for author tags and because we use Fisheye, the annotated source view it offers is a much better representation of what's going on.

It really depends on what your drivers are for documenting authoring information. Certainly the original architect/engineer should be noted and any significant authors since, if it were an open sourced project, you'd probably want to be more stringent about it. It'll be interesting to see how others approach this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜