今天查看activiti的README,突然发现一段很有意思的FAQ。
Why do you not accept @author lines in your source code?
Because the author tags in the java files are a maintenance nightmare
A large percentage is wrong, incomplete or inaccurate.
Most of the time, it only contains the original author. Many files are completely refactored/expanded by other authors.
Git is accurate, that is the canonical source to find the correct author.
Because the author tags promote code ownership, which is bad in the long run.
If people work on a piece they perceive as being owned by someone else, they tend to:
only fix what they are assigned to fix, instead of everything that's broken
discard responsibility if that code doesn't work properly
be scared of stepping on the feet of the owner.
Credit to the authors is given:
with Open Hub which also has statistics
in the GitHub web interface.
问题:为什么不在源码中使用 @author ?
首先,@author 是什么?
Java 文档注释标签。
其他常用的有:
@author 作者
@param 输入参数的名称 说明
@return 输出参数说明
@since JDK版本
@version 版本号
@see 链接目标
@throws 异常
@deprecated
为什么不用?
activiti作者认为:
- 不利于java文件的后期维护。
- 对于长久来说,为代码标明所有者是很糟糕的事情。
- 代码版本工具提供了作者的提交历史记录,不需要再单独标识。
我觉得说的很有道理!
但是,公司内部的管理来说,有些人就是喜欢打上程序员的标签。
好吧,全世界的问题都是程序员的错!