top | item 7390954

(no title)

dsaravel | 12 years ago

I have been checking the code for the generation of the spheres. I never developed C++ professionally. Is this code considered good C++ practice? I mean I saw "using namespace std", and exceptions using cout.

discuss

order

seabrookmx|12 years ago

If it's just a simple demo app, I probably wouldn't use it as a example of good C++ practice.

Many C++ devs have a different idea on what idiomatic C++ should look like. C++11 really shakes things up as well.

There's no reason a "using namespace std;" is bad, as long as it isn't in the header. If it's in the header file, every file that includes that header will have it's namespace polluted with std declarations, and this leads to a big nasty chain of potential name conflicts (one header file includes another and so on and so forth).

dsaravel|12 years ago

Right, it makes perfect sense. Thanks for that.