Do Comments follow Commenting Conventions? A Case Study in Java and Python
Pooja Rani, Suada Abukar, Nataliia Stulova, Alexandre Bergel, Oscar, Nierstrasz

TL;DR
This study investigates whether Java and Python developers follow existing commenting style guidelines, revealing a focus on content over syntax and highlighting gaps in current conventions that can inform future comment quality tools.
Contribution
It provides an analysis of style guidelines versus actual developer practices in Java and Python, identifying gaps and areas for improving comment quality checking tools.
Findings
Most guidelines focus on comment content rather than syntax or formatting.
Developers often do not follow existing commenting conventions.
Current guidelines do not adequately address important developer concerns.
Abstract
Assessing code comment quality is known to be a difficult problem. A number of coding style guidelines have been created with the aim to encourage writing of informative, readable, and consistent comments. However, it is not clear from the research to date which specific aspects of comments the guidelines cover (e.g., syntax, content, structure). Furthermore, the extent to which developers follow these guidelines while writing code comments is unknown. We analyze various style guidelines in Java and Python and uncover that the majority of them address more the content aspect of the comments rather than syntax or formatting, but when considering the different types of information developers embed in comments and the concerns they raise on various online platforms about the commenting practices, existing comment conventions are not yet specified clearly enough, nor do they adequately…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research
