Using namespace might not be the best idea because

Using usingnamespace std can cause a namespace clash, where there may have several different namespaces for the same word. Over time this will become overwhelming and confusing for you to read, let alone other people try and read it.

Hi Guys,

I agree fully with Jarad_Fraser and just to point out, as a good programmer, we all are capable enough to include proper namespaces before using it’s contents so that won’t be a problem, the problem is for our own sake, if we write lot of code, we eventually will get lost and having spent lots of hours on Debugging on C# few years ago, I know how hard that is. Which is why, I want to stick to exclusive way std::cout because we already have lot of help thanks to Ctrl+C , Ctrl+V & most importantly, incredible IDE Visual Studio

Thanks & Regards,
Bhanu

std::cout for every call is actually the more confusing of the two options.
One of the goals for maintainable code is readability

Ask yourself which is easier to read.

cout << “Test line” << endl;

or
std::cout << “Test line” << std:endl;

Privacy & Terms