TY - GEN
T1 - An empirical study of goto in C code from github repositories
AU - Nagappan, Meiyappan
AU - Robbes, Romain
AU - Kamei, Yasutaka
AU - Tanter, Éric
AU - Mcintosh, Shane
AU - Mockus, Audris
AU - Hassan, Ahmed E.
PY - 2015/8/30
Y1 - 2015/8/30
N2 - It is nearly 50 years since Dijkstra argued that goto obscures the ow of control in program execution and urged programmers to abandon the goto statement. While past research has shown that goto is still in use, little is known about whether goto is used in the unrestricted manner that Dijkstra feared, and if it is harmful' enough to be a part of a post-release bug. We, therefore, conduct a two part empirical study - (1) qualitatively analyze a statistically representative sample of 384 files from a population of almost 250K C programming language files collected from over 11K GitHub repositories and find that developers use goto in C files for error handling (80:21 ± 5%) and cleaning up resources at the end of a procedure (40:36 ± 5%); and (2) quantitatively analyze the commit history from the release branches of six OSS projects and find that no goto statement was re- moved/modified in the post-release phase of four of the six projects. We conclude that developers limit themselves to using goto appropriately in most cases, and not in an un- restricted manner like Dijkstra feared, thus suggesting that goto does not appear to be harmful in practice.
AB - It is nearly 50 years since Dijkstra argued that goto obscures the ow of control in program execution and urged programmers to abandon the goto statement. While past research has shown that goto is still in use, little is known about whether goto is used in the unrestricted manner that Dijkstra feared, and if it is harmful' enough to be a part of a post-release bug. We, therefore, conduct a two part empirical study - (1) qualitatively analyze a statistically representative sample of 384 files from a population of almost 250K C programming language files collected from over 11K GitHub repositories and find that developers use goto in C files for error handling (80:21 ± 5%) and cleaning up resources at the end of a procedure (40:36 ± 5%); and (2) quantitatively analyze the commit history from the release branches of six OSS projects and find that no goto statement was re- moved/modified in the post-release phase of four of the six projects. We conclude that developers limit themselves to using goto appropriately in most cases, and not in an un- restricted manner like Dijkstra feared, thus suggesting that goto does not appear to be harmful in practice.
UR - http://www.scopus.com/inward/record.url?scp=84960394591&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84960394591&partnerID=8YFLogxK
U2 - 10.1145/2786805.2786834
DO - 10.1145/2786805.2786834
M3 - Conference contribution
AN - SCOPUS:84960394591
T3 - 2015 10th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2015 - Proceedings
SP - 404
EP - 414
BT - 2015 10th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2015 - Proceedings
PB - Association for Computing Machinery, Inc
T2 - 10th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE 2015
Y2 - 30 August 2015 through 4 September 2015
ER -