Identifier characteristics across programming languages and project domains: an empirical study
摘要
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