Variable Naming 101 - Because Your Variables Are a Mess

Variables are like socks - they're all over the place and sometimes you can't even find the ones you're looking for. But fear not! We've got the ultimate guide to naming your variables like a pro!

Descriptive Names are Key

In our example, we'll use a variable named `girlyMcGirly`. This name is a good starting point for a variable, as it's clear and to the point. But what about when you need to use a variable multiple times?

Prefix/Suffix Conventions

We recommend prefixing or suffixing your variable names with a descriptive word or abbreviation to avoid conflicts.

For example: `girl_`, `mcg_`, or `__girly`

Use a Dictionary, Not Your Imagination

Ditch the creative names for a while and use the dictionary instead. Look up the word you're thinking of and use it as your variable name. In our case, we could use `feminine` instead of `girlyMcGirly`.

Subpages:

Advanced Variable Naming Techniques for when you want to get really fancy.

Case Insensitive Variable Naming for when you want to drive your coworkers crazy.