3 ms·
Naming things is only hard if you are trying to be consistent across a large systems, or hoping that names will replace documentation and assumptions. If you a
by Jare 14y ago
Naming things is only hard if you are trying to be consistent across a large systems, or hoping that names will replace documentation and assumptions.
If you are going to ban names, I nominate the entire index of the GoF book: Factory, Singleton, Command, Proxy, etc. all sort of convey an idea of the kind of stuff they probably do, but nothing truly precise about the details.
Or I can just accept a rough meaning of the word, name my classes / modules / variables / etc reasonably and then rely on a coherent approach to design and documentation to provide with the details.
- XXXManager: owns the lifetime of objects of class XXX and the relationships between them.
- XXXHandler: responds to events relating to XXX.
- XXXFactory: creates instances of the polymorphic type XXX
- etc.