title: c# naming convention for variables with same data but different types
body: <p>I've consulted a few msdn articles that address c# coding conventions and naming guidelines (<a href="http://msdn.microsoft.com/en-us/library/vstudio/ff926074.aspx" rel="noreferrer">C# Coding Conventions</a> and <a href="http://msdn.microsoft.com/en-us/library/xzf533w0%28v=vs.71%29.aspx" rel="noreferrer">Naming Guidelines</a>) as well as a <a href="https://stackoverflow.com/q/11659036/573083">similar question</a> on stack overflow from a few months back. </p>
  
  <p>I'm not certain how to handle two variables which are in scope at the same time, that hold the [conceptually] same data in different types.</p>
  
  <p>An example which would help illustrate the issue would be an identifier that is initially held as a string, but is then cast/parsed to an integer.   </p>
  
  <p>I've come up with 3 possible courses of action, and I'm sure that I missed plausible options. </p>
  
  <p><strong>COA #1:</strong>
  </p>
  
  <pre><code>int iRecordId;
  string sRecordId;
  </code></pre>
  
  <p>Where one or both of the variables prefix a type abbreviation.  This violates the MS coding guidelines stating not to prefix parameter names with Hungarian type notation.</p>
  
  <p><strong>COA #2:</strong>
  </p>
  
  <pre><code>int recordId;
  string recordIdString;
  </code></pre>
  
  <p>Where one or both of the variables explicitly state the type in the name.  This just seems klunky and while it doesn't use Hungarian notation, it seems to violate the spirit of the previous COA.  </p>
  
  <p><strong>COA #3:</strong>
  </p>
  
  <pre><code>int recordIdForDatabase;
  string recordIdFromUrl;
  </code></pre>
  
  <p>Where each variable is further qualified by where the data came from, or is going.  </p>
  
  <p><strong>Proposal</strong></p>
  
  <p>My thought is that I ultimately want to distinguish between two variables that only differ by type, so while there are guidelines that explicitly state not to prefix variables with type information, I'm leaning towards using a Hungarian prefix. Since it is in stark contrast with the naming conventions in the remainder of the code, it seems that it will highlight the extenuating circumstance.  Is this a reasonable approach?</p>
  
  <p>Questions, comments, and cries of outrage are all welcomed. </p>