Answer the question
In order to leave comments, you need to log in
Should I switch to std:: or is it better to stay with using namespace std?
I write in C++. I heard that good programmers use std:: . Should I also go and write in the same way, or is it better to stay on using namespace std and not hang the crap on my ass?
Answer the question
In order to leave comments, you need to log in
And what are the downsides to using using namespace std ? In my opinion, none, it only makes the code more readable.
The main problem is possible name conflicts, especially if you specify the use of multiple namespaces in this way. In addition, there is a risk of getting a lot of options for various constructs in the IDE's autocompletion list. By itself, std is a very short identifier, so it doesn't make much sense to omit it.
PS
In addition, never write "using namespace" in header files. Except when you really understand what you are doing.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question