Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is sa1200 All using directives must be placed inside the namespace (StyleCop) purely cosmetic? [duplicate]

Tags:

c#

stylecop

Possible Duplicate:
Should Usings be inside or outside the namespace

sa1200 All using directives must be placed inside the namespace (StyleCop)

Is this just for code readibility or is there any actual advantage to doing so? Does it help the GC somehow?

like image 266
Matt Avatar asked Jul 01 '09 23:07

Matt


2 Answers

It definitely won't help with GC.

Here's the discussion about two styles:

http://blogs.msdn.com/abhinaba/archive/2006/08/21/709051.aspx

http://blogs.msdn.com/abhinaba/archive/2008/07/08/do-namespace-using-directives-affect-assembly-loading.aspx

like image 140
SolutionYogi Avatar answered Sep 22 '22 07:09

SolutionYogi


If you have multiple namespaces in your project, you can limit which namespaces are used by each one individually.

This might come in handy if there were class names in two different namespaces that were the same. One might be the default in one part of your project, while the other could be the default in another.

Yes they look for some really fringe cases for these rules.

like image 36
Brad Bruce Avatar answered Sep 18 '22 07:09

Brad Bruce