It's obvious why using
using namespace std;
is considered bad practice. As I'm fairly new to C++ (about 8 months now) I wondered if it is still considered bad practice when I use
using std::cout;
using std::cin;
using std::endl;
and so on to only include what I need instead of including the whole namespace. My old teacher always told us to not use that as well but my new teacher told us it's just fine to use the using
-Declaration compared to including the whole namespace.
What do you use and would you consider it a bad practice or not?
I hope this question is not a duplicate but I did not find another question like this, just questions about why it's considered to be bad practice to use using namespace std;
, but like mentioned above I already know that.