quick question about std - efficiency
I remember reading/hearing somewhere here that the line using namespace std; is best avoided, and its better to use std::cout, std::string, etc. Is this true? and if so, would you be able to explain? Thanks.
It has nothing to do with efficiency. You should never use a using directive or declaration in a header since that can change the meaning of subsequent code; however putting using namespace std in a source file after the headers is fine.
Quote:Original post by agm_ultimatexUsing default namespaces makes for somewhat less readable code, in some people's estimation. It's not a question of efficiency, just cleanliness and readability. I don't subscribe to this notion for any language except C++; C++ needs all the help it can get to remain readable and clean.
I remember reading/hearing somewhere here that the line using namespace std; is best avoided, and its better to use std::cout, std::string, etc. Is this true? and if so, would you be able to explain? Thanks.
Ahhh I read this thread title and was expecting some dubious replies. I've been on forums too long.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement