Naming
400 words 2 minutes
The power of naming extends far beyond programming. From ancient myths where knowing something’s true name gave power over it, to modern branding where companies spend millions on finding the right name, to parents carefully choosing names for their children – our ability to name things shapes how we think and communicate about them.
In software development, this universal human trait becomes absolutely crucial. Unlike physical engineering where you can point to concrete objects, programming deals entirely with mental constructs and abstract concepts. We can’t touch or see our constructs directly – we can only refer to them by name. Almost all concepts programming languages provide to create abstractions have one really important thing in common. They all have the ability to name the abstraction. This is among others true for variables, functions, classes and namespaces.
The name is the most important part of a good abstraction.
In fact, the name is their most important feature. Without a descriptive name it wouldn’t be an abstraction anymore. Every time we needed to use an unnamed abstraction we would need to look inside it to find out which one it is. That totally defeats the purpose of creating abstractions in the first place.
For many problem domains there does not exist a good and stringent enough nomenclature. We therefore usually need to create one. When we do that we should take that task seriously. Getting it right will not only make it easier for the programmers following in our footsteps but also for ourselves. Good names help us to reason about a problem. We should also spend effort to document our definitions of the different names used as a reminder to ourselves and to help future programmers.
By putting more effort into naming you can avoid a lot of trouble and refactoring later.
Getting naming right is one of the really hard parts of programming. It is at the core of why it sometimes is easier to start over from scratch than to incrementally improve code written by others. By putting more effort into the naming you can avoid a lot of trouble and refactoring later.