你在Visual Studio中使用哪些标记?(Visual Studio 2010 → 环境 → 任务列表 → 标记)
目前我只有以下几种:
- HACK - 优先级较低
- REVIEW - 优先级高
- TODO - 普通优先级
- WTF - 优先级高
(只使用这些,删除了默认的一些)
你还使用其他的吗?
你是否用注释标记来覆盖其他重要内容?
有什么最佳实践吗?谢谢!
你在Visual Studio中使用哪些标记?(Visual Studio 2010 → 环境 → 任务列表 → 标记)
目前我只有以下几种:
(只使用这些,删除了默认的一些)
你还使用其他的吗?
你是否用注释标记来覆盖其他重要内容?
有什么最佳实践吗?谢谢!
我已经结合使用了上面大多数标记。
RED: code that simply does not work / compile
// Error - This code is throwing a specific reproducible error.
// Broken - This code is broken and will not run.
// WTF - WHAT THE FRIG.
ORANGE: code that works but is not right
// Hack - This code has intentionally been hacked in order to work. Should not go into production.
// FixMe - This code works but could be better. Needs better abstraction, maintainability, performance, etc.
// Bug - This code works and was expected to be right but a bug has been found. (usually flagged post production)
// Review - This code is probably right but should be reviewed for piece of mind.
// Smells - Same as FixMe
BLUE: code that works but either needs more features or more explaining
// Todo - Functionality is not yet implemented
// Note - Better explain what's going on. This is gives a higher profile to standard comments, and allows notes to be found in the to-do pane.
以下是我使用的标记:
我喜欢“REMOVE Token” (即移除令牌) 这个术语,它表明该令牌仅用于测试,并不应包含在最终版本中。
// REMOVE
更容易。 - Gabriel另一个内置的是NOTE。
XXX
,这恰好是我选择的标记,因为它很容易输入。根据Sun(旧版)Java编码规范,使用XXX
来表示某些虚假但可行的东西,在注释中进行标记。使用FIXME
来表示某些虚假且有问题的东西,在注释中进行标记。请参考此处了解更多信息。