视觉工作室中的令牌:HACK,TODO …任何其他?
什么令牌在视觉工作室中有用? ( visual studio 2010 → 环境 → 任务列表 →令牌)
目前我只有:
- HACK – 低
- 评论 – 高
- TODO – 正常
- 跆拳道 – 高
(只有这些 – 删除了一些默认的)
你在用别的吗?
你是否用评论标记覆盖了其他重要的东西?
任何最佳实践? 日Thnx
这是我使用的:
- TODO :function尚未实现
- FIXME :代码应该被修改/重构以实现某个目标(更高的可维护性,更好的性能等等)
- 错误 :代码有一个已知的错误
我已经完成了大部分上述标记的组合。
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.
另一个内置的是注意。
我喜欢Token REMOVE,表示它只用于testing,不应该包含在最终版本中
Vim自动突出显示XXX
,这恰好是我轻松打字的首选标记。
Sun的(旧)Java编码惯例有这样的说法:
在评论中使用
XXX
标记是虚假的,但工作。 使用FIXME
来标记一些虚假的东西。