# Log or comments? **Published by:** [75个基点](https://paragraph.com/@75-2/) **Published on:** 2022-07-14 **URL:** https://paragraph.com/@75-2/log-or-comments ## Content 绝大多数的程序注释都可以写成 log info 或是log debug以及 Unit Test,这样一来,代码质量和工程能力至少上一个新的台阶。 每个写代码的人都知道,注释对于你搞清代码是怎么运作的几乎是没有什么帮助的,最好的方式就是debug一下代码,看代码运行时的那些context(变量里的值,状态,条件,执行路径等)是什么样的?这时,注释是低效的,把这些上下文打在debug log里才是高效的。 ## Publication Information - [75个基点](https://paragraph.com/@75-2/): Publication homepage - [All Posts](https://paragraph.com/@75-2/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@75-2): Subscribe to updates