Code comments are important for program comprehension, development, and maintenance tasks. Given the varying standards for code comments, and their unstructured or semi-structured nature, developers get easily confused (especially novice developers) about which convention(s) to follow, or what tools to use while writing code documentation. Thus, they post related questions on external online sources to seek better commenting practices. In this paper, we analyze code comment discussions on online sources such as Stack Overflow (SO) and Quora to shed some light on the questions developers ask about commenting practices. We apply Latent Dirichlet Allocation (LDA) to identify emerging topics concerning code comments. Then we manually analyze a statistically significant sample set of posts to derive a taxonomy that provides an overview of the developer questions about commenting practices. Our results highlight that on SO nearly 40% of the questions mention how to write or process comments in documentation tools and environments, and nearly 20% of the questions are about potential limitations and possibilities of documentation tools to add automatically and consistently more information in comments. On the other hand, on Quora, developer questions focus more on background information (35% of the questions) or asking opinions (16% of the questions) about code comments. We found that (i) not all aspects of comments are covered in coding style guidelines, e.g., how to add a specific type of information, (ii) developers need support in learning the syntax and format conventions to add various types of information in comments, and (iii) developers are interested in various automated strategies for comments such as detection of bad comments, or verify comment style automatically, but lack tool support to do that.
翻译:代码评论对于程序理解、开发和维护任务很重要。 鉴于代码评论的标准不同,且其非结构化或半结构化性质不同,开发商很容易被混淆(特别是新开发商)哪些公约要遵循,或者在写入代码文档时使用哪些工具。 因此,他们在外部在线源中发布相关问题,以寻求更好的评论做法。 在本文件中,我们分析关于Stack Overflow (SO)和Quora等在线源的代码评论讨论,以阐明开发商就评论做法提出的问题。 我们应用Leent Dirichlet 分配 (LDA) 来识别有关代码评论的新主题。 然后我们手动地分析一组具有统计重要性的抽样员额,以获得一个分类学,以概述关于评论做法的开发商问题。 因此,我们的结果显示,近40%的问题提到了如何在文件工具和环境中撰写或处理评论,近20%的问题是关于文件工具的潜在限制和可能性,可以自动和一致地在评论中添加更多信息。 另一方面,在Qura, 开发商评论中, 开发商 更侧重于背景信息(35 % ) 或排序中,我们发现的具体定义类型,,在排序中,在排序中,我们发现,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,如何上,我们是如何,如何,如何,在排序中,在排序中,如何,如何,在排序中,如何,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,如何,在排序中,在排序中,在排序中,在排序中,在排序中,在排序中,如何,如何,如何,在排序中,在排序中,如何,如何,如何,在,在,在,在,在,在,我们,如何,如何,在排序中,我们,在,在,在,在,在,在,我们,在排序中,如何,如何,我们,我们,我们,我们,在排序中,如何,在,在排序中,我们,在,在,在,在,在,在,在,在排序中