SFML community forums
General => General discussions => Topic started by: Helios101 on January 04, 2014, 01:13:59 am
-
.
-
It is a namespace like std. Use
using namespace sf;
if it bothers you.
-
It is a namespace like std. Use using namespace sf;
if it bothers you.
Never use "using namespace" for any namespace. It is widely considered bad practice due to causing namespace collisions and the fact that the namespace clarifies where a function/class/etc is coming from, making code a bit easier to understand and making it easier to find the proper documentation for a function/class/etc.
-
It is a namespace like std. Use using namespace sf;
if it bothers you.
Never use "using namespace" for any namespace. It is widely considered bad practice due to causing namespace collisions and the fact that the namespace clarifies where a function/class/etc is coming from, making code a bit easier to understand and making it easier to find the proper documentation for a function/class/etc.
Don't say never. You can use "using namespace" in a scoped block which can be advantageous. What you really don't want to do is use a namespace outside of a scoped block, such as in the global space of a header file. You can read here (http://stackoverflow.com/questions/223021/whats-the-scope-of-the-using-declaration-in-c) for more ideas.
-
That has nothing to do with SFML, the syntax comes from the programming language, C++.
-
It is a namespace like std. Use using namespace sf;
if it bothers you.
Never use "using namespace" for any namespace. It is widely considered bad practice due to causing namespace collisions and the fact that the namespace clarifies where a function/class/etc is coming from, making code a bit easier to understand and making it easier to find the proper documentation for a function/class/etc.
Don't say never. You can use "using namespace" in a scoped block which can be advantageous. What you really don't want to do is use a namespace outside of a scoped block, such as in the global space of a header file. You can read here (http://stackoverflow.com/questions/223021/whats-the-scope-of-the-using-declaration-in-c) for more ideas.
Wow, that's pretty sweet! I guess I never thought to do that, haha.