开发者

How do you set the author in a java class comment?

For our in house development it is common use to write the authors of a java class into the class comment.

It will be written in the form of

* @author Doe, John (john.doe@example.com)

All authors will be listed in this form, the one who did the most work on this class will be listed first.

My question(s): How do you deal with such a requirement? Do you set the authorship in the comment or do you use y开发者_C百科our source repository to track this information? What is the best format to write the authors name AND email?


Your source control has the most correct information about who did what and when in a class. It's the only reliable source of information (except if several users share the same user/password).

I usually don't care about the @author tag which, most of the time is automatically inserted by the IDE at the creationof the class. Use it as you want, and choose the format you want.

BTW, who does the more work? The one who writes the whole class code, or the one who changes one line of code to fix a production bug after two weeks of investigation?


I like this format:

* @author <ul><li>John Doe (john.doe@example.com)</li><li>...</li>...</ul>

It prints a list, about name and email. I like to see the Name and the Email in that format. It is easy to read. The format Surname, name I found it too formal. It is not intended to order by Surname so why bother?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜