Tom Ritchford
Sep 2, 2018 · 1 min read

The reason people think this is a bad idea is not because they are purists, but because it’s risky, and because it makes the code harder to read.

When you do this, you have just imported a very large number of symbols into your top level — likely thousands of symbols.

One day you’re going to use a symbol name from std:: in your code, and you will get the std:: function or method instead of the one you expect. Hopefully the compiler will catch it but sometimes it will quietly do the wrong thing.

It’s also easier for other people reading. If I see string in your code, I’m just not sure what it is until I look around and find your using statement elsewhere in the code. It’s even worse if it’s a common symbol like copy or fill. But if I see std::copy I know in an instant what’s going on.

    Tom Ritchford

    Written by

    uk->at->ca->us->nl

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade