I've taken 2 classes on C++ so far, one each at a different school, and both of them have used 'using namespace std;' to teach basic programming. It may be a coincidence but I had to go out of my way to find out it's not a good practice to do so.
Why do college computer science classes promote 'using namespace std'?
633 views Asked by gr33kbo1 At
2
Because best practices when writing sample code are not necessarily best practices when writing large projects.
In a C++ course, you write mainly small programs (up to a few hundred lines of code) that have to solve a relatively small problem. This means little to no focus on future maintenance (and avoiding sources of confusion for future maintainers).
Because many teachers simply do not have coding experience in large projects, the problem doesn't even get acknowledged (let alone discussed) in most C++ courses.