Thursday, 8 September 2016

c++ - Why is "using namespace std;" considered bad practice?

I've been told by others that writing using namespace std; in code is wrong, and that I should use std::cout and std::cin directly instead.



Why is using namespace std; considered a bad practice? Is it inefficient or does it risk declaring ambiguous variables (variables that share the same name as a function in std namespace)? Does it impact performance?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...