Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ([email protected])

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 your source repository to track this information? What is the best format to write the authors name AND email?

like image 953
magomi Avatar asked Dec 28 '22 15:12

magomi


1 Answers

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?

like image 166
JB Nizet Avatar answered Jan 13 '23 21:01

JB Nizet