Be Careful with Naming in Software Development

Naming can be complicated, as it’s all too common to take naming for granted and is the sometimes an overlooked practice in software development. Naming is important so that other developers can understand your code. There are two syntax modes you can utilize in naming as well, known as Camel Case and Pascal Case. An example would be myStore, and MyStore respectively. This is a small detail but important with certain modes of syntax. Functions in javaScript are usually in camelCase while naming classes in C# are PascalCase. The reasoning for explaining this small detail is not only do you follow common standards so that other developers can understand how your code works, but to create consistency in code.

Even more challenging is having a descriptive enough name so they can understand what the code means. It’s easy to name a variable myLog, when it be far more descriptive to name it gratitudeLog. You can see clearly that myLog does not give a sufficient amount of detail for the developer to understand what the variable is supposed to store.

The reason this is brought up, is when you write many lines of code it’s easy to get lazy and create temporary names that we plan to rename later but never get to because we get into another task. This seems like such a small thing, but it’s often the small things in coding that get overlooked that cause larger problems. Essentially, write with intention and meaning the first time you get at it. Other developers or cohorts may say, “oh we can come back to that” because they may not want to lose their train of thought on the current problem, but that is a common mistake, especially when we think about human error. Just do it right the first time, and you will have peace of mind.

Leave a Reply