Discussion about this post

User's avatar
Foersom's avatar

first_name and last_name are bad variable naming. First name in one language may have a different meaning in another language, e.g. in French the family name is written first (usually in all capital letters). So a better variable naming would be: given_name and family_name, to make clear what is what.

Good naming of variables and function are important for readable source code. To help me find the right name I often use synonym dictionaries to get ideas for better naming. My favorite online synonym dictionary is WordHippo.

Another aspect of naming is using opposite words for related start-stop functions: Open / Close, Start / Stop, Begin / End, Acquire / Release, Enter / Exit

Expand full comment
Akos Komuves's avatar

This is a great write-up Eric! Naming is an important code-quality metric that should deserve more attention.

In my ideal world, I always name variables based on what they hold. So for example of I’m always selecting Wednesdays, I’d do this:

wednesday = week[2]

Expand full comment
3 more comments...

No posts