The Love/Hate Relationship with the C Preprocessor: An Interview Study

Flávio M. Medeiros, Christian Kästner, Márcio Ribeiro, Sarah Nadi, Rohit Gheyi
{"title":"The Love/Hate Relationship with the C Preprocessor: An Interview Study","authors":"Flávio M. Medeiros, Christian Kästner, Márcio Ribeiro, Sarah Nadi, Rohit Gheyi","doi":"10.4230/LIPIcs.ECOOP.2015.495","DOIUrl":null,"url":null,"abstract":"The C preprocessor has received strong criticism in academia, among others regarding separation of concerns, error proneness, and code obfuscation, but is widely used in practice. Many (mostly academic) alternatives to the preprocessor exist, but have not been adopted in practice. Since developers continue to use the preprocessor despite all criticism and research, we ask how practitioners perceive the C preprocessor. We performed interviews with 40 developers, used grounded theory to analyze the data, and cross-validated the results with data from a survey among 202 developers, repository mining, and results from previous studies. In particular, we investigated four research questions related to why the preprocessor is still widely used in practice, common problems, alternatives, and the impact of undisciplined annotations. Our study shows that developers are aware of the criticism the C preprocessor receives, but use it nonetheless, mainly for portability and variability. Many developers indicate that they regularly face preprocessor-related problems and preprocessor-related bugs. The majority of our interviewees do not see any current C-native technologies that can entirely replace the C preprocessor. However, developers tend to mitigate problems with guidelines, even though those guidelines are not enforced consistently. We report the key insights gained from our study and discuss implications for practitioners and researchers on how to better use the C preprocessor to minimize its negative impact.","PeriodicalId":172012,"journal":{"name":"European Conference on Object-Oriented Programming","volume":"63 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"80","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"European Conference on Object-Oriented Programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4230/LIPIcs.ECOOP.2015.495","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 80

Abstract

The C preprocessor has received strong criticism in academia, among others regarding separation of concerns, error proneness, and code obfuscation, but is widely used in practice. Many (mostly academic) alternatives to the preprocessor exist, but have not been adopted in practice. Since developers continue to use the preprocessor despite all criticism and research, we ask how practitioners perceive the C preprocessor. We performed interviews with 40 developers, used grounded theory to analyze the data, and cross-validated the results with data from a survey among 202 developers, repository mining, and results from previous studies. In particular, we investigated four research questions related to why the preprocessor is still widely used in practice, common problems, alternatives, and the impact of undisciplined annotations. Our study shows that developers are aware of the criticism the C preprocessor receives, but use it nonetheless, mainly for portability and variability. Many developers indicate that they regularly face preprocessor-related problems and preprocessor-related bugs. The majority of our interviewees do not see any current C-native technologies that can entirely replace the C preprocessor. However, developers tend to mitigate problems with guidelines, even though those guidelines are not enforced consistently. We report the key insights gained from our study and discuss implications for practitioners and researchers on how to better use the C preprocessor to minimize its negative impact.
C预处理器的爱/恨关系:一项访谈研究
C预处理器在学术界受到了强烈的批评,其中包括关注分离、错误倾向和代码混淆,但在实践中被广泛使用。存在许多(主要是学术上的)预处理器的替代方案,但尚未在实践中采用。由于开发人员不顾所有批评和研究继续使用预处理器,我们询问从业者如何看待C预处理器。我们与40名开发人员进行了访谈,使用基础理论来分析数据,并使用202名开发人员的调查数据、存储库挖掘和先前研究的结果来交叉验证结果。特别地,我们调查了四个相关的研究问题:为什么预处理器在实践中仍然被广泛使用、常见问题、替代方案以及无序注释的影响。我们的研究表明,开发人员意识到C预处理器受到的批评,但仍然使用它,主要是为了可移植性和可变性。许多开发人员表示,他们经常面临与预处理器相关的问题和与预处理器相关的错误。我们的大多数受访者都没有看到任何当前的C原生技术可以完全取代C预处理器。然而,开发人员倾向于使用指导方针来缓解问题,即使这些指导方针没有得到一致的执行。我们报告了从我们的研究中获得的关键见解,并讨论了从业者和研究人员如何更好地使用C预处理器以最大限度地减少其负面影响的影响。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信