Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Tecla

Pages: [1]
1
General discussions / why not using a namespace
« on: August 25, 2007, 08:22:21 am »
Yeah, generally the rule of thumb is to not put 'using namespace blahblah' into global scope, unless it is in a cpp file (and even then you might consider only doing it in function or class scope as suggested by PM).

On a game project I'm working on at a certain huge game development publisher, that's the rule we adopted for our team.  We have mandated that we namespace-ify all of our code, but we have forbidden 'using' statements in header files except where you can restrict it to a specific scope.  All of the intellisense-type tools and whatnot then make navigating namespaces to find identifiers really easy, and it makes for quick identification of where code logically fits into modules and sub-modules.

For C APIs, they use prefixes on their types and functions because, well, there weren't namespaces to do that job even better.  For DirectX, it was first developed back when there was no namespace support in C++, and worse, it had to conform to the COM interfaces (which probably didn't easily allow themselves to be put into namespaces, at least when they were first introduced to Visual C++).

2
General discussions / why not using a namespace
« on: August 20, 2007, 10:52:39 pm »
I agree; namespaces are cleaner and have all of the advantages given above, and they would help adoption for sure.

What I suggest is moving everything into the 'sf' namespace (or even 'sfml' would be better), then creating sub-namespaces for each package, and move the appropriate types into those.  Then you can keep around a compatibility header that typedefs all of the namespace-correct versions into the old prefix-style versions; that keeps code changes to a minimum for those that don't want to have to change all the code they've already written just yet.

I would do it, but I'm in the middle of trying to move to the SF bay area to start a new job at a movie VFX studio.  :D  I am definitely interested in contributing to this project.  (I'd love to help with or see Gtk+ integration, as well as a Tao Framework package corresponding to this or some other .NET interface so you get exposure from that side of the fence.)

Pages: [1]
anything