Why is naming things important?
Humans have a deep-seated need to name and be named, and researchers have long acknowledged that there is great power in naming things. We name to identify, symbolize, refer, describe, simplify, organize and, most importantly, to tame. When you tame something, you do so to bring it closer.
What is an example of a brand name?
Although brands are generally intangible, we often associate things like products and names with brands. Examples include Apple, Nike, Coca-Cola, Advil, and Tylenol.
When to use a prefix in a class name?
Nouns and noun phrases should be used rarely and they might indicate that the type should be an abstract class, and not an interface. ❌ DO NOT give class names a prefix (e.g., “C”). ✔️ CONSIDER ending the name of derived classes with the name of the base class.
How to write the name of a class?
Nouns and noun phrases should be used rarely and they might indicate that the type should be an abstract class, and not an interface. X DO NOT give class names a prefix (e.g., “C”). ✓ CONSIDER ending the name of derived classes with the name of the base class. This is very readable and explains the relationship clearly.
How to name classes, structs, and interfaces?
The naming guidelines that follow apply to general type naming. ✔️ DO name classes and structs with nouns or noun phrases, using PascalCasing. This distinguishes type names from methods, which are named with verb phrases. ✔️ DO name interfaces with adjective phrases, or occasionally with nouns or noun phrases.
What’s the best approach to naming classes?
Sometimes, naming concrete classes simply is more important to communication than hiding the use of interfaces. In this case, prefix interface names with “I”. If the interface is called IFile, the class can be simply called File. For more detailed discussion, buy the book! It’s worth it! 🙂