Commenting Source Code: Is It Worth It for Small Programming Tasks? (2018)(cse.cs.ovgu.de)
cse.cs.ovgu.de
Commenting Source Code: Is It Worth It for Small Programming Tasks? (2018)
https://cse.cs.ovgu.de/cse/commenting-source-code-is-it-worth-it-for-small-programming-tasks-5/
3 comments
I comment almost everything obsessively because I’m not a real programmer and its a way for me to add professionalism and make the stuff presentable when I inevitably have to ask someone to help me get it working.
I try to let my code be self-documenting (self-explonatory function/variable names etc) with little to no commenting as possible. I don't always achieve what I set out to accomplish though. I can revisit my code after a few months and my initial thought can be 'What?'. That's a big hint that I failed and it's time to add some comments.
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 are comments in 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, we i) partly replicate previous studies, ii) investigate performances of differently experienced participants when confronted with varying types of comments, and iii) 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.
Link to paper [pdf]: https://cse.cs.ovgu.de/cse-wordpress/wp-content/uploads/2018...