删除的注释代码? [英] Commenting code that is removed?
问题描述
是否一个好的做法是注释删除的代码?例如:
Is it a good practice to comment code that is removed? For example:
// Ajahn在10/10/08删除了{task} 。
在同行评审期间,我的开发人员组中的某人注意到,我们应该评论要删除的代码行。我认为这是一个可怕的建议,因为它杂乱的代码与无用的意见。
Someone in my developer group during a peer review made a note that we should comment the lines of code to be removed. I thought this was a terrible suggestion, since it clutters the code with useless comments. What are your thoughts.
推荐答案
一般来说,删除的代码不应该被注释,正是因为它杂乱的代码库为什么要对不存在的东西发表评论?)
Generally, code that is removed should not be commented, precisely because it clutters the codebase (and, why would one comment on something that doesn't exist?).
您的缺陷跟踪系统或源代码控制管理工具是这些评论所属的地方。
Your defect tracking system or source control management tools are where such comments belong.
这篇关于删除的注释代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!