0

What's the advantage of doing this:

namespace a
{
    using System;

    class ClassA
    {

    }
}

over this

using System;

namespace a
{
     class ClassA
     {
     }
}

is there any performance advantage or best practices?

Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
Baahubali
  • 4,604
  • 6
  • 33
  • 72

1 Answers1

3

There's definitely no performance difference at runtime since namespace resolution is done at compile time, and I doubt there's a significant compile time difference either.

All the C# code I've seen has the using statements at the top of the file, so I'd consider that more "normal".

gregstoll
  • 1,318
  • 9
  • 14
  • thanks for the reply. i have found the answer in the other post where this question has already been answered. i have marked my question as duplicate. – Baahubali Dec 24 '15 at 02:11