DEV Community


Discussion on: Do you have a process for naming things?

cjbrooks12 profile image
Casey Brooks

Variable names don't matter much to me. Variables are ephemeral (unless they're global variables, which make me sad), so the names don't go very far in the codebase.

I find consistency in naming to be rather important. Things that follow a consistent naming convention make it easier to understand disparate parts of the codebase because there are similar patterns in names.

As @gypsydave5 notes, once a name is in place it tends to stick, but bad naming only gets worse if you try to fix bad names half-way through the codebase. A bad naming convention that is followed throughout the codebase still gives valuable information, because it relates other parts of the code. A good name that doesn't follow the convention makes everything harder to understand, which actually makes it a really bad name.