您认为 Visual Studio 中哪些标记有用? (Visual Studio 2010→环境→任务列表→令牌)
目前我只有:
(仅这些 - 删除了一些默认的)
你还用其他的吗?
您是否用评论标记涵盖了任何其他重要的事情?
有什么最佳实践吗?谢谢
我已经完成了上述大部分令牌的组合。
RED: code that does not work/compile
// Error - This code throws a specific reproducible error.
// Broken - This code is broken and will not run.
// WTF - WHAT THE F*CK.
ORANGE: code that works but is not right
// Hack - This code has intentionally been hacked to work. It 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 peace 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 gives a higher profile to standard comments and allows notes to be found in the to-do pane.
这是我使用的:
我喜欢 Token REMOVE,表明它仅用于测试,不应包含在最终版本中
另一个内置的是NOTE。
Vim 自动突出显示
XXX
,这恰好是我选择的标记,以便于输入。
Sun 的(旧)Java 编码约定 有这样的说法:
在评论中使用
来标记虚假但有效的内容。使用XXX
标记虚假和损坏的内容。FIXME