title: Defining Local Variable const vs Class const
body: <p>If I am using a constant that is <strong>needed only in a method</strong>, is it best to declare the const within the method scope, or in the class scope? Is there better performance declaring it in the method? If that is true, I think it's more standard to define them at class scope (top of file) to change the value and recompile easier.</p>
  
  <pre><code>public class Bob
  {
     private const int SomeConst = 100; // declare it here?
     public void MyMethod()
     {
        const int SomeConst = 100; // or declare it here?
        // Do something with SomeConst
     }
  }
  </code></pre>