title: Naming conventions in C# - Global Variables
body: <p>I know there is a debate/opinion about using <code>this</code> keyword or underscore in regards to private fields/properties (and I'll mention, I'm stuck on .NET 2.0)</p>
  
  <p>Personally, I prefer <code>this</code>, but there are times you can't use it, for example when you need to reference a global variable from within a static method. Well, then we are forced to use the underscore (assuming we only have 2 choices, <code>this</code> or underscore). This means if my class uses any static methods I can't use <code>this</code> throughout the document.</p>
  
  <p>Now, I've read the <a href="http://msdn.microsoft.com/en-us/library/xzf533w0%28VS.71%29.aspx" rel="nofollow">naming guidelines</a> and used <a href="http://stylecop.codeplex.com/documentation" rel="nofollow">StyleCop</a>, both would rather I don't use the underscore, but my Resharper pretty much insists on using _.</p>
  
  <p>I don't feel it is right to have one class use the _ and the next class use <code>this</code> simply to accommodate for when the classes mixes non-static and static methods! The advice here on SO is to keep to one implementation/style but I don't know if that means I should ignore Microsoft (and I know MS don't always follow their own rules)!</p>
  
  <p>It has been suggested to prefix with something else, similarish to Hungarian but prefix with globVariableName where glob indicates global. I hate this idea, it's too bespoke and won't be obvious to any other developer outside my team.</p>
  
  <p>So, my question is, what is the best way to define global variables consistently? Since they are naming guides, may be I can just ignore (at least _ can be used consistently but it feels wrong to ignore the advice from the language creators). </p>