C++

Asked • 09/22/19

Why is "using namespace std" considered bad practice?

I've been told by others that writing `using namespace std` in code is wrong, and that I should use `std::cout` and `std::cin` directly instead. Why is `using namespace std` considered a bad practice? Is it inefficient or does it risk declaring ambiguous variables (variables that share the same name as a function in `std` namespace)? Does it impact performance?

1 Expert Answer

By:

Keith B. answered • 09/22/19

Tutor
4.6 (22)

Software Engineer and Math Geek

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.