你对代码中的错误修复使用特殊注释吗? [英] Do you use special comments on bug fixes in your code?

查看:76
本文介绍了你对代码中的错误修复使用特殊注释吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一些同事对他们的错误修正使用了特殊注释,例如:

Some of my colleagues use special comments on their bug fixes, for example:

// 2008-09-23 John Doe - bug 12345
// <short description>

这是否有意义?

您是否以特殊方式评论错误修复?

Does this make sense?
Do you comment bug fixes in a special way?

请让我知道。

推荐答案

在这样的评论中,源代码控制系统已经维护了该历史记录,并且我已经能够记录文件的历史了。

I don't put in comments like that, the source control system already maintains that history and I am already able to log the history of a file.

我写了描述为什么一些不明显的事情正在做。因此,如果错误修复使代码不可预测和清晰,那么我解释为什么。

I do put in comments that describe why something non-obvious is being done though. So if the bug fix makes the code less predictable and clear, then I explain why.

这篇关于你对代码中的错误修复使用特殊注释吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆