title: C#: Should the default value of an enum be None or Unknown?
body: <p>Say you have an enum that represents an error code. There will be several codes, each with their own underlying int value; however, the enum value that gets the default 0 value seems like it should be carefully considered.</p>
  
  <p>In the case of an error code enum, there are two special values that I can think of: None (for cases when there is no error) and Unknown (for cases when no existing error code is appropriate, or perhaps even when error state cannot be detected).</p>
  
  <p>One of these values seems like it should get 0, where the other will probably get something else like -1. Is it more appropriate to set the None value to 0, or the Unknown value to 0?</p>
  
  <pre><code>public enum ErrorCode
  {
      None = -1,
      Unknown = 0,
      InsufficientPermissions,
      ConnectivityError,
      ...
  }
  
  public enum ErrorCode
  {
      Unknown = -1,
      None = 0,
      InsufficientPermissions,
      ConnectivityError,
      ...
  }
  </code></pre>
  
  <p>My instinct tells me that the default should be Unknown, but I'm curious if anyone has done it differently.</p>