An empirical study of goto in C code
نویسندگان
چکیده
It is nearly 50 years since Dijkstra argued that goto obscures the flow 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 2 million 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 removed/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 unrestricted manner like Dijkstra feared, thus suggesting that goto does not appear to be harmful in practice.
منابع مشابه
Code-Copying in the Balochi Language of Sistan
This empirical study deals with language contact phenomena in Sistan. Code-copying is viewed as a strategy of linguistic behavior when a dominated language acquires new elements in lexicon, phonology, morphology, syntax, pragmatic organization, etc., which can be interpreted as copies of a dominating language. In this framework Persian is regarded as the model code which provides elements for b...
متن کاملImplementing Continuation based language in GCC
In this example, a code segment f has input a and sends output b to a code segment g. There is no return from code segment b, b should call another continuation using goto. Any control structure in C is allowed in CwC language, but in case of CbC, we restrict ourselves to use if statement only, because it is sufficient to implement C to CbC translation. In this case, code segment has one input ...
متن کاملModeling of Reversible Chain Transfer Catalyzed Polymerization by Moment Equations Method
A moment equations method was performed to study the Reversible chain Transfer Catalyzed Polymerization (RTCP) of styrene in 80°C. To do this, a kinetic scheme containing conventional free radical polymerization reactions and equilibrium reactions of RTCP was assumed. After obtaining mass balance equations, three moment equations were defined for free and dormant radicals and dead chains. M...
متن کاملKINETIC STUDIES USING SEMI-EMPIRICAL SELF- CONSISTENT FIELD (SCF) MOLECULAR ORBITAL (MO) METHOD: PARTI. A MODIFIED NEGLECT OF DIATOMIC OVERLAP (MNDO) STUDY OF THE PYROLYSIS OF ETHYL VINYL ETHER
Using a computer code called MOPAC, an acronym for a general Molecular Orbital Package (Quantum Chemistry Programme Exchange (QCPE) Programme No. 455), the geometries and heats of formation of the reactant, the products and the trdnsition state were computed by the MNDO semi- empiricalself consistent field (SCF) method for the pyrolysis of ethyl vinyl ether. ((Force))calculation on the reac...
متن کاملHVL evaluation of orthovoltage X-ray machine using EGSnrc code of simulation
Background: Making use of the orthovoltage machines in Radiotherapy, is one of the routine methods for the treatment of the superficial lesions. In this study, an important determinant of X-ray quality, the HVL (Half Value Layer), has been evaluated. Materials and Methods: The HVLs of a orthovoltage X-ray machine in 120 and 180 kVp are measured, using an empirical method, in which the HVLs are ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- PeerJ PrePrints
دوره 3 شماره
صفحات -
تاریخ انتشار 2015