[时间:2017-09] [状态:Open]
[关键词:代码注释,TODO, FIXME, XXX]
阅读开源代码时可能经常遇到TODO、FIXME、XXX的单词,通常这些都是有其特殊含义的。
中文版的说明
-
TODO: + 说明:
如果代码中有该标识,说明在标识处有功能代码待编写,待实现的功能在说明中会简略说明。 -
FIXME: + 说明:
如果代码中有该标识,说明标识处代码需要修正,甚至代码是错误的,不能工作,需要修复,如何修正会在说明中简略说明。 -
XXX: + 说明:
如果代码中有该标识,说明标识处代码虽然实现了功能,但是实现的方法有待商榷,希望将来能改进,要改进的地方会在说明中简略说明。
英文版的说明
- NOTE: Description of how the code works (when it isn't self evident).
- XXX: Warning about possible pitfalls, can be used as NOTE:XXX:.
- HACK: Not very well written or malformed code to circumvent a problem/bug. Should be used as HACK:FIXME:.
- FIXME: This works, sort of, but it could be done better. (usually code written in a hurry that needs rewriting).
- BUG: There is a problem here.
- TODO: No problem, but addtional code needs to be written, usually when you are skipping something.
小结
整理这部分内容主要是给后续参考,直接搜索对应关键词,搜索引擎上一般会提供比较多的链接。加强下记忆。