Why you should care
Short identifiers were in existence as early variable mnemonics were limited to as few as six to eight characters leading to many developers abbreviating concepts in their variable names. However, in the past thiry years since 2009, there has been a steady increase in permitted name length and an increase in identifier length. Due to such advancements, performance and memory is increasing resulting in making short identifiers obsolete. Short identifiers also decreases code agility and leave room for bugs.
Business Impacts
It is not recommended have short identifiers as they are outdated, resulting in greater utilization of costs. The code will be unappealing to clients and developers in the near future as well resulting in a loss of time.
CAST Recommendations
CAST recommends avoiding smaller functions and identifiers by having them at a more reasonable length so that it won’t cause confusion to developers. Since collaborative development is far more common, it is recommended to have code with properly formatted functions and identifiers. This reduces confusion between developers in a team and that would greatly save time and costs for the business. This is vital for Agile Software Development
How we detect
This code insight shows that procedures, functions and packages should have significant identifiers names.
About CAST and Highlight’s Code Insights
Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.