In C #, the using directive only affects the area of โโthe file or namespace in which it is located.
If you enable using namespace std; in the C ++ header file, this affects not only this file, but also each of its files. This creates conflicting potential in other people's files.
You can easily say that this is not a โbest practiceโ in C #, but the risk associated with it is much lower than in C ++, since it only affects the content area or namespace in which the directive is located.
Reed copsey
source share