The Influence of Code Comments on the Perceived Helpfulness of Stack Overflow Posts
Kathrin Figl, Maria Kirchner, Sebastian Baltes, and Michael Felderer

TL;DR
This study shows that code comments significantly enhance the perceived helpfulness of Stack Overflow answers, especially for novices, and highlights implications for AI coding tools and community platforms.
Contribution
It provides empirical evidence on the impact of code comments on perceived helpfulness and discusses implications for AI tools and community-driven knowledge sharing.
Findings
Comments increase perceived helpfulness of answers
Novices find block comments more helpful than inline comments
Answer position and score are less influential
Abstract
Question-and-answer platforms such as Stack Overflow are an important way for software developers to share and retrieve knowledge. However, reusing poorly understood code can lead to serious problems, such as bugs or security vulnerabilities. To better understand how code comments affect the perceived helpfulness of Stack Overflow answers, we conducted an online experiment simulating a Stack Overflow environment (n=91). The results indicate that both block and inline comments are perceived as significantly more helpful than uncommented source code. Moreover, novices rated code snippets with block comments as more helpful than those with inline comments. Interestingly, other surface features, such as the position of an answer and its answer score, were considered less important. Moreover, the content of Stack Overflow has been a major source for training large language models. AI-based…
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.
