Namespaces
Names
The importance of naming is underscored in the biblical story of creation.
In the book of Genisis, the first task given to Adam was that of naming
each element of creation.
A name is an identifier. Names form the basis of communication. Names
give us the power to specify a particular object, a group of objects, or
a type of object. When we use a name, we communicate meaning and
enable understanding.
Names resolve ambiguity. Imagine a world without names. Try communicating
using the word "thing" in place of each name in a sentence. This feature
is really nice when it comes to digital computers, since computers don't
deal well with ambiguity.
In the wonderful world of software, we encounter names in two forms.
-
As the textual instructions of a programming language.
-
As the numbers that form the instructions and addresses that are executed
by digital processors.
Namespaces
A namespace is a context in which each name must be unique.
Choosing Names
For trivial self contained software projects, the process of choosing names
is relatively simple, and the consequences of choosing poorly result in
an inconvenience at best. However, a developer that is writing software
that is intended to be reused in another context has a much greater responsibility.
Indeed, even if the intent to reuse a given piece of software is not there,
it is frequently the case that proof-of-concept code actually becomes the
framework for the "real" code. Coder beware.
When it comes to software, nam
Unambiguous Names
Choosing Good Names
mike@mnmoran.org