Should You Add Comments to Your Code? – Insights from Refactoring
This discussion post examines whether code should be commented, citing the book *Refactoring* and emphasizing that needing comments often signals the need for refactoring, while good variable names can serve as implicit documentation, and stresses the importance of clear interface comments.
//你的代码加注释吗?
//纯讨论帖,欢迎留言(拍砖)~
《重构》里面说,如果你的代码需要加注释,才能看明白,说明代码该重构了。没有注释的代码不是好代码,变量名本身就是一种注释手段。
不写注释,必须拖出去打死!复杂业务加少量注释,简单业务用变量名标记啦。要加要加,不然我真的看不懂以前大师(屎)的神逻辑。
模块外部接口必须加注释说明。是没功夫写,还是不愿意写?你说清楚。要写就好好写,不要错别字。
代码到底加不加注释?
360 Quality & Efficiency
360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.