

Both ways are fine.Which way is proper?

Both and neither. The best part about standards is that there's so many to choose from!wswartzendruber wrote:So I'm working on a class library that uses Qt4 exclusively. QCA does this, and all of its classes have their own namespace. Qt4 itself doesn't put things in a namespace (it seems), but instead chooses to prefix everything with the letter Q. Which way is proper?


Although I have used this in the past one disadvantage is this makes your identifier names even longer well unless you usedoubleagent wrote:Seconded.dmitchell wrote:I suggest you use a namespace.
Code: Select all
using namespace namespace_name
tUh... twhat tgood tis ta tprefix tif tyou tprefix teverything? That's exactly as braindead as that Microsoft-ish prefixing of all member variables with m_. How about somebody with time on their hands writes a little library to represent C/C++/Java in a canonical form and the option to apply coding and tabbing style as well as naming conventions like stylesheets... (of course the editor of choice then in turn would have to enforce that set of conventions to retain bijectivity)? Or is there something like that out there already?Earthwings wrote:At work I have to prefix everything with a 't' for "historic reasons", and I hate it with a passion

Code: Select all
namespace long_namespace_name { ... }
namespace lnn = long_namespace_name;
Thanks I was not aware of that. Thanks.Also, be aware of the possibility of namespace aliases
Probably not. Force of habit after writing somewhere between 600K and 800K lines of MFC code over the last 12 to 13 years...But do you really have that many variables (that of course have speaking names) around that you need that?