When creating MeaningfulName''''''s for concepts or operations that are closely related to one another, it is a good idea to use strongly related names. This is especially true when one of the operations is the opposite or complement of the other. Some examples of good complementary names are: * ''true'' and ''false'' * ''on'' and ''off'' * ''read'' and ''write'' * ''throw'' and ''catch'' * ''begin'' and ''end'' * ''suspend'' and ''resume'' * ''create'' and ''destroy'' * ''construct'' and ''destruct'' * ''open'' and ''close'' * ''acquire'' and ''release'' * ''in'' and ''out'' * ''enter'' and ''exit'' Unfortunately, many common complementary terms used by computer programmers and computer users do not follow this rule. For example, ''get'' and ''set'' are not complements anywhere but in program source code. The opposite of ''get'' should be something like ''give'' or ''lose''. ''Put'' is close, but is still not what a non-programmer would tell you is the opposite of ''get''. ''Set'' seems to have many complementary terms, including ''get'', ''reset'', and ''clear''. Some bad name choices involve mixing uncomplementary words. Many programmers will write code where they "open" a file but then "dispose" of the handle when finished, or "lock" something and then "release" it later, or "get" input but then "write" output. This causes unnecessary confusion for readers of the code. Some other examples of bad complementary pairs that we have to live with are: * ''push'' and ''pop'' (the opposite of ''push'' is ''pull'') * Extended discussion Moved to ''PushAndPop'' * ''0'' and ''1'' (makes sense to people who think in binary, but to nobody else) * ''new'' and ''delete'' * ''car'' and ''cdr'' Some would argue that these are all technical terms, with technical definitions, and that any non-technical connotations or obscure relationships between the terms are irrelevant. Experienced programmers know what they mean. The "bad" pairs described above are well-established, so there is no need to start a crusade to eradicate them. Just think about these examples when you are creating new names for things, and avoid creating sets of names that belong on this list. The situation is bad when programmers create it for themselves, but it is even worse is when such jargon makes it into the user interface or user manual, leaving a nontechnical user to try to figure out the relationship between two terms that are seemingly unrelated, or which seem synonymous. Here are some examples: * ''OK'' and ''cancel'' (better would be ''yes'' and ''no'', ''accept'' and ''reject'', or ''continue'' and ''abort'') * ''Turn off computer'' is on the ''Start'' menu * Some InstantMessenger systems have both a ''chat'' feature and a ''talk'' feature, which do completely different things. * The ''system log'' does not record the times that people ''log in'' or ''log out'' of the system. (Maybe it does on your system, but it's not universal.) * Is ''exiting'' the application the same as ''closing'' it? Problems also arise through lack of any complementary term for a given term. For example, a video game's settings may include a checkbox labeled "Enable 16-bit textures". It is not clear to the user what it means to leave this box unchecked: does it use no textures at all, or 8-bit textures, or 32-bit textures, or something else entirely? ---- See also NameByContrast, SystemOfNames ---- CategoryCodingIssues CategoryNaming