A while ago, various sources pointed me to the great video below by [Wayback/Archive] Felienne Hermans: How patterns in variable names can make code easier to read – YouTube.
I responded to the first Tweet with a series of tweets describing my two pet-peeves that I see going wrong when teaching new programmers how to name things (the examples are in Delphi, but I have seen similar shortcuts being taken in C#, VB.NET, and JavaScript being taught in both courses and conference sessions).
The two pet-peeves are:
- avoid abbreviations as those are context sensitive; given software development already mixes technical context (it’s software development!) and domain/semantic context it makes it extra hard to decipher abbreviations
- if you want/need to mix technology and semantics in names (most often you do), start with the most meaningful semantics and end with the least meaningful technology
- if you don’t need technology in your names, at least put the most meaningful semantics and end with the least meaningful technology
Both very well amend what Felienne – a university professor – states in her research backed video:
“Their results show that ‘linguistic code smells’ actually increase cognitive loads,” she said. “Your brain has to work harder to process code that has these type of code smells. So that’s not what we want.”
I saved the [Wayback/Archive] tweets in the [Wayback/Archive] ThreadReader as this text (slightly edited for formatting):





