3 Names and Namespaces
This chapter covers
- Names
- Naming Conventions
- Namespaces
The names we give things and concepts help us navigate the world and communicate with everyone else who shares this world. The idea that names matter is even more important in the world of software development. Programming languages have keywords, grammar, and syntax that is generally a subset of a common, in-use language. In the case of Python, that language is English.
For programming language, this means we have keywords, grammar, and syntax to create programs that will eventually run. Naming things in those programs, however, is entirely within your control. You can use anything from the rich set of English words to name the things you create in a program. You can even use strings of nonsense characters if that suits you. But should you?
"There are only two hard things in Computer Science: cache invalidation and naming things."
The quote is attributed to Phil Karlton, a programmer with Netscape, the developers of the first widely used web browser. Putting aside cache invalidation, you might be thinking, "what's so hard about naming things." Let's find out.