一句话:通过分析 5 种语言 150 个项目的注释密度,揭示注释习惯因语言与项目用途而异。
源代码注释对软件至关重要,但跨领域、跨编程语言的注释撰写基本模式仍不清晰。本文迈出理解注释实践差异的第一步,对 5 种不同编程语言中的 150 个项目进行了注释密度分析。研究发现,项目之间的注释密度存在明显差异,这种差异可能与项目所使用的编程语言以及项目目的有关。该工作为后续大规模注释实践研究提供了初步经验证据,并提示研究者需结合语言与项目语境解释注释指标。
Source code comments are important for any software, but the basic patterns of writing comments across domains and programming languages remain unclear. In this paper, we take a first step toward understanding differences in commenting practices by analyzing the comment density of 150 projects in 5 different programming languages. We have found that there are noticeable differences in comment density, which may be related to the programming language used in the project and the purpose of the project.
DOI 原文 ·
@inproceedings{paperbot5114,
title = {Understanding source code comments at large-scale},
author = {Hao He},
booktitle = {FSE},
year = {2019},
doi = {10.1145/3338906.3342494}
}