Why is it that some programmers omit the use of "using namespace std?" in their program?

And rather use “std::” before each time they use cout/cin?

I’m currently taking Intro to CS 140, and the way I’m learning is to use the “using namespace std” at the top with your typical header files, yet I noticed other people’s source code using std followed by the scope operator?

Is there an advantage in declaring it?

The likeliest reason a programmer would not use “using” is the namespace conflicts with code in the project or another library in use.

It would not be unusual for any project or library with “history” to have created functions or symbols with the same name as something in the std:: namespace.

1 Like