visual-studio Visual Studio 中的令牌:HACK、TODO ......还有其他吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2944360/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
tokens in visual studio: HACK, TODO... any other?
提问by b0x0rz
what tokens do you find useful in visual studio? (visual studio 2010→ environment→ task list→ tokens)
你觉得 Visual Studio 中哪些标记有用?(visual studio 2010→环境→任务列表→ 令牌)
currently i have only:
目前我只有:
- HACK- low
- REVIEW - high
- TODO- normal
- WTF - high
- 黑客-低
- 评论 - 高
- 待办事项- 正常
- WTF - 高
(only these - deleted some default ones)
(只有这些 - 删除了一些默认的)
are you using any others?
你在用其他的吗?
are you covering any other important thing with comment tokens?
您是否使用评论标记涵盖任何其他重要事项?
any best practices? thnx
任何最佳做法?谢谢
采纳答案by Enrico Campidoglio
Here's the ones I use:
这是我使用的:
- TODO: the functionality is not yet implemented
- FIXME: the code should be modified/refactored to achieve some goal (higher maintainability, better performance, and so on)
- BUG: the code has a known bug
- TODO:功能尚未实现
- FIXME:应该修改/重构代码以实现某些目标(更高的可维护性、更好的性能等)
- BUG: 代码有一个已知的错误
回答by Chase Florell
I've done a combination of most of the above tokens.
我已经完成了上述大多数令牌的组合。
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.
回答by KevinA
I like the Token REMOVE, indicating that it's only in for testing, and should not be included in the final release
我喜欢Token REMOVE,说明它只用于测试,不应该包含在最终版本中
回答by Tim Lloyd
Another built-in is NOTE.
另一个内置是 NOTE。
回答by Mark Rushakoff
Vim automatically highlights XXX, which happens to be my token of choice for the ease of typing it.
Vim 会自动突出显示XXX,这恰好是我选择的标记,以便于输入。
Sun's (old) Java coding conventionshave this to say:
Sun 的(旧)Java 编码约定是这样说的:
Use
XXXin a comment to flag something that is bogus but works. UseFIXMEto flag something that is bogus and broken.
XXX在评论中使用以标记虚假但有效的内容。使用FIXME来标记的东西是假的,并打破。

