/Naming

When To Use Cute Names Or Descriptive Names

- Nicole Tietz-Sokolskaya tl;dr: If a name is hard to change and the code is likely to evolve, use a creative, "cute" name. A descriptive name becomes a liability if it can't keep up with changes. If a name is easy to change, use a descriptive and unambiguous name, even if it gets verbose. Verbosity signals when something needs refactoring. Nicole shares high-level thoughts around naming.

featured in #504


What’s In A Name?

- Adam Raider tl;dr: Tips for naming from Google: (1) Spend time considering names — it’s worth it, especially APIs. (2) Describe behavior. (3) Reveal intent with a contextually appropriate level of abstraction. (4) Prefer unique, precise names. (5) Balance clarity and conciseness—use abbreviations with care. (6) Avoid repetition and filler words. (7) Software changes —names should, too. 

featured in #501


On The Importance Of Naming In Programming

- Martin Sosic tl;dr: “The best advice is maybe not to give a name, but instead to find out a name. You shouldn’t be making up an original name, as if you are naming a pet or a child; you are instead looking for the essence of the thing you are naming, and the name should present itself based on it. If you don’t like the name you discovered, it means you don’t like the thing you are naming, and you should change that thing by improving the design of your code.” Martin gives a couple of examples.

featured in #457


Names Should Be As Short As Possible While Still Being Clear

- Ben Hoyt tl;dr: “Some developers do use names that are too short. However, I think the more common mistake is using names that are overly long.” Ben illustrates this point, and the importance of naming in context, using examples.

featured in #430


Naming Conventions In Programming – A Review Of Scientific Literature

- Iwo Herka tl;dr: This article is divided into 2 chapters: (1) “Introduction to naming in programming”: A review of scientific literature present on the topic to deepen your understanding of the current body of knowledge on naming things. (2) “Guidelines for naming conventions in programming”: recommendations to improve your skills in choosing thoughtful class, function or variable names.

featured in #397


Taming Names In Software Development

- Joseph Glass tl;dr: "Balancing these opposing principles is what makes good naming so hard. The amount of knowledge conveyed in a single word is what makes good naming so powerful. The exact balance will depend on the size of the codebase and developer team, the domain complexity, frequency of use and many other factors."

featured in #374


Start Test Names With “Should”

tl;dr: Reasons include: (1) It removes redundancy, because the function name should already be in the call stack. (2) It is falsifiable i.e. a person reviewing the test can decide to which degree the name agrees with the actual test. (3) Encourages testing one property of the function per test.

featured in #323


Why Naming Stuff Is Hard?

- Shekhar Gulati tl;dr: Shekar provides 3 reasons: (1) Developers don’t re-read their code often enough. (2) Lack of business domain understanding. (3) Undervalue good naming. Also, helpful questions to ask: "which business concept is this functionality related to? How can I map business terms to code? What can I learn from API contracts and / or documentation of competitors?"

featured in #313


Please Put Units In Names

- Ruud van Asseldonk tl;dr: Ruud compares similar looking lines of code in Python, Java and Haskell, and shows us how they each have very different outcomes and that the the underlying issue is a "code readability trap." Ruud recommends putting units into names or using strong types.

featured in #301