Nate Bross Posted October 3, 2008 Posted October 3, 2008 Which of these methods do you use, and why? namespace some.longish.winded.name.space { class something { } } or namespace some { namespace longish { namespace winded { namespace name { namespace space { class something { } } } } } } Clearly the second approach leads to much greater level of indentation, which could be annoying on a small screen. What advantages do you see to one over the other? Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Administrators PlausiblyDamp Posted October 4, 2008 Administrators Posted October 4, 2008 I tend to use the first version when all classes in a file are part of the same namespace - it is less typing and easier to read. If I have more than one namespace in a single file (not common and I don't think I've ever had more than one namespace plus a single nested namespace) then the second form can sometimes be more readable. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Diesel Posted October 11, 2008 Posted October 11, 2008 First version, for readability, brevity. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.