Taking Advantage of Namespaces
00:01 Remember that I listed separate namespace as one of the advantages of dividing code into individual modules. And the fourth advantage is scoping: modules have their own namespace.
00:15 Here’s why namespaces are a cool thing. Namespaces bring you three advantages: they group names into logical containers, they prevent clashes between duplicate names, and third, they provide context to names.
00:31 By adjusting your import statements to cater to your needs, you can curate your calling module’s namespace. So when you import modules, use good judgment so that you preserve the most context possible.
00:45 Okay. We’ve talked quite a bit about modules so far in this course, but there is another term that is floating around when talking about modules, and that’s packages. After all, packages are part of the title of this course, right?
00:58 So let’s find out why they are worth to be mentioned in the course title next.
Become a Member to join the conversation.