Logo

View the Project on GitHub wesdollar/geek-source

Naming Variables, Functions, Methods, etc.

Code should tell a story.

Code should read like a book, describing exactly what's happening in plain English. We make this possible by being mindful to assign meaningful names to our variables, functions, methods, directories, files, and anything else. Younger developers tend to struggle with naming, which is understandable. Below are some tips and tricks I use to ensure the name I assign today has meaning to six-months-from-now me.

Pro Tip: If the name you think is best is already in use, there's a good chance the code needs to be refactored.

Here's a cool naming cheatsheet: https://github.com/kettanaito/naming-cheatsheet