Commenting source code: is it worth it for small programming tasks?

Commenting source code: is it worth it for small programming tasks?
复制标题

DOI:
10.1007/s10664-018-9664-z
复制
发表时间:
2018-11
影响因子:
4.1
通讯作者:
Sebastian Nielebock;Dariusz Krolikowski;J. Krüger;Thomas Leich;F. Ortmeier
Sebastian Nielebock;Dariusz Krolikowski;J. Krüger;Thomas Leich;F. Ortmeier
中科院分区:
计算机科学2区
文献类型:
--
作者:
Sebastian Nielebock;Dariusz Krolikowski;J. Krüger;Thomas Leich;F. Ortmeier

文献摘要

被引文献

相似文献

在软件工程中,维护程序是一项耗时且昂贵的任务。因此,已经提出了几种方法来提高源代码的可理解性。其中一种方法是在代码中添加注释,使开发人员能够用自己的语言或预定义的标记来解释程序。一些实证研究表明,评论在某些情况下有好处,而另一些研究则发现根本没有好处。因此,评论对软件开发的真实的影响仍然不确定。在本文中,我们描述了一个实验,其中277名参与者,主要是专业软件开发人员,对不同注释的代码执行小型编程任务。基于定量和定性的反馈,wei)部分重复以前的研究,ii)调查不同经验的参与者面对不同类型的评论时的表现,iii)讨论开发人员对评论的看法。我们的研究结果表明,评论似乎被认为是更重要的,在以前的研究中,我们的参与者比他们的小编程任务。虽然我们的与会者认为其他机制,如适当的识别资料,更有帮助,但它们也强调在某些情况下评论的必要性。
Maintaining a program is a time-consuming and expensive task in software engineering. Consequently, several approaches have been proposed to improve the comprehensibility of source code. One of such approaches arecommentsin the code that enable developers to explain the program with their own words or predefined tags. Some empirical studies indicate benefits of comments in certain situations, while others find no benefits at all. Thus, the real effect of comments on software development remains uncertain. In this article, we describe an experiment in which 277 participants, mainly professional software developers, performed small programming tasks on differently commented code. Based on quantitative and qualitative feedback, wei) partly replicate previous studies,ii) investigate performances of differently experienced participants when confronted with varying types of comments, andiii)discuss the opinions of developers on comments. Our results indicate that comments seem to be considered more important in previous studies and by our participants than they are for small programming tasks. While other mechanisms, such as proper identifiers, are considered more helpful by our participants, they also emphasize the necessity of comments in certain situations.