• KoalaUnknown@lemmy.worldOP
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    edit-2
    2 days ago

    Yes, it’s cut down for the meme.

    In reality, it would probably look more like this:

    
    public class Singleton
    {
      private static readonly Lazy<Singleton> lazy = new Lazy<Singleton>(() => new Singleton());
    
      private Singleton(){}
    
      public static Singleton Instance
      {
          get
          {
             return lazy.Value;
          }
       }
    }
    
    

    or this:

    
    public class Singleton
    {
       private static readonly Singleton instance = new Singleton();
    
       private Singleton(){}
    
       public static Singleton Instance => instance;
    }
    
    
    • MonkderVierte@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      19 hours ago

      Second is more readable.

      Btw lazy; why can “second” be “zweite” or “Sekunde” depending on context??

      • optional@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        15 hours ago

        Why can „Bank“ be a 🏦 or a 🛋️? It’s a common feature of many languages that words can have multiple meanings. It’s called Teekesselchen in German, which is funny because Teekesselchen is a Teekesselchen itself: It can either mean „small tea kettle“ or „word with more than one meaning“.

        But more importantly, why is there no emoticon for bench? I had to use a couch instead.