title: lazy initialization of singletons
body: <p>While reading <a href="http://csharpindepth.com/Articles/General/Singleton.aspx" rel="nofollow noreferrer">Jon Skeet's article on singletons in C#</a> I started wondering why we need lazy initialization in a first place. It seems like the fourth approach from the article should be sufficient, here it is for reference purposes:</p>
  
  <pre><code>public sealed class Singleton
  {
      static readonly Singleton instance=new Singleton();
  
      // Explicit static constructor to tell C# compiler
      // not to mark type as beforefieldinit
      static Singleton()
      {
      }
  
      Singleton()
      {
      }
  
      public static Singleton Instance
      {
          get
          {
              return instance;
          }
      }
  }
  </code></pre>
  
  <p>In the rare circumstances, where you have other static methods on a singleton, lazy initialization may have benefits, but this is not a good design.</p>
  
  <p>So can people enlighten me why lazy initialization is such a hot thing?</p>