We’ve had some design discussions where we’ve come across 4 types of string
names. These terms came mostly from discussing debugging symbols, but they
extend to naming in general.
|Type||Example for function||Example for filename|
|Fully qualified names (FQN): An FQN is a well defined string
with a formal grammar that provides sufficient identification that it
could be used to persistently refer to the object it’s naming. For
example, a full path name would be an FQN for a given machine.
FQNs should have very well defined semantics and it should be specified
what APIs produce and consume them. If two FQNs are the same, they
should represent the same object.
(includes module, class, and mangled function name)
|Partially qualified names (PQN): You could also have a
Partially Qualified Name (PQN) which still has some context, but does
not specify as much as an FQN. PQNs are shorter and can be more
convenient than FQNs.
|Simple Names: A Simple Name is a single meaningful component
of an FQN that still provides some identification. A filename (without
path) would be a simple name. The extension would not be a Simple Name
because it does not provide enough meaning. Simple Names can be put
together using a grammar to form a FQN.
(just the mangled function name)
|Pretty Names: Pretty names have no formal meaning but may be
of interest to an end user. A Simple Name can usually serve as a Pretty
Name. However, Pretty Names can be useful when the FQNs / simple names
are either much to verbose or don’t map well to a user construct. For
example, a module may have a generated name like "XY56_QY23.data". The
pretty name may be "Bob’s files". Pretty names aren’t sufficiently
formal as to be consumed by an API.
(unmanaged form of simple name)
(same as simple name)
The key themes here are:
1) What can I do with the name? What other APIs can I pass the name back
2) Is there a formal grammar for the name that I can use to compose / decompose
3) Name identity: If two names are the same, do they refer to the same object?
4) How much context does the name need in order to have meaning?