Introduction
Namespaces help keep code organized and avoid name conflicts by grouping related names together.
When you have many functions or variables with similar names in different parts of a program.
When using code from libraries that might have names matching your own code.
When you want to clearly show which part of code a function or variable belongs to.
When you want to avoid typing long names repeatedly by using namespace shortcuts.
When you want to separate your code logically into different sections.