Skip to main content

What is "using namespace" pollution?

I was looking at the google coding guide [here] and they do not recommend that one use the using namespace or namespace:function` - if I did not misinterpret it.

Does this apply to std as well? cout<< does not work without it. This book, recommends the same. So how do I go about using cout<< without using namespace std; or std::cout<< ?

What is the recommended way? std::cout<<? Most c++ text books teach beginners with using namespace std; are they propagating poor coding practice?

Lord Loh.
  • 1.8k
  • 1
  • 14
  • 22