<p>Identifier names convey important semantic cues in source code and are crucial to program understanding. However, despite the introduction of many lexicon metrics, large-scale, holistic examinations of code identifiers remain limited. In this work, we investigate which factor—programming language or project domain—exerts the greatest influence on identifier characteristics. To address this question, we examined a set of fourteen identifier metrics, including basic properties (length, frequency of duplicates, number of abbreviations, etc.) and more complex measures (term entropy, context coverage, semantic similarity, word concreteness, conciseness &amp; consistency violations). Our empirical study encompassed 9,801 open source projects spanning nine programming languages, three paradigms (functional, imperative, and object-oriented), and thirteen project domains. The results show that programming language, project domain, and their interaction are all statistically significant in shaping identifier naming practices. Furthermore, while programming language emerges as a stronger factor than domain and is practically significant, the language <InlineEquation ID="IEq1"> <EquationSource Format="TEX">\(\times\)</EquationSource> </InlineEquation> domain interaction also appears robust and practically relevant.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Identifier characteristics across programming languages and project domains: an empirical study

  • Iwo Herka,
  • Bartosz Biderman

摘要

Identifier names convey important semantic cues in source code and are crucial to program understanding. However, despite the introduction of many lexicon metrics, large-scale, holistic examinations of code identifiers remain limited. In this work, we investigate which factor—programming language or project domain—exerts the greatest influence on identifier characteristics. To address this question, we examined a set of fourteen identifier metrics, including basic properties (length, frequency of duplicates, number of abbreviations, etc.) and more complex measures (term entropy, context coverage, semantic similarity, word concreteness, conciseness & consistency violations). Our empirical study encompassed 9,801 open source projects spanning nine programming languages, three paradigms (functional, imperative, and object-oriented), and thirteen project domains. The results show that programming language, project domain, and their interaction are all statistically significant in shaping identifier naming practices. Furthermore, while programming language emerges as a stronger factor than domain and is practically significant, the language \(\times\) domain interaction also appears robust and practically relevant.