Pros and Cons of "using namespace xyz;"

Hello dear @ben and Community,

the biggest contra of using “using namespace xyz” is that the code is more difficult to read for a programmer who is looking at the first time at the code.

Two pros of using “using namespace xyz” is that the code is more overseeable and the programmer will save time.

EDIT: One more big contra of using “using namespace xyz” is that the namespace will be inherited to sub-classes. This can cause weird / unexpected behaviour.

Kind regards
Kevin

Thanks for this, and I’d agree. Enjoy the course.

1 Like

Privacy & Terms