Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    I think you're creating a straw-man argument about the "accidental" creation aspect. I see one benifit of the singleton being that a new developer can come on board, see the code, and know with ABSOLUTE CERTAINTY that there is only one instance created, accidental or otherwise. That's not to detract from your other points. Commented Sep 8, 2009 at 11:02
  • 2
    And what difference does that make, in the big picture? If the new developer can't come on board and trust what his coworkers say about the code (such as, "only one instance is created", then he's going to have to manually doublecheck everything else as well. So no, I think you're making the straw-man argument. The newcomer is going to have to trust his coworkers word on pretty much anything else, so I really don't see why he need ABSOLUTE CERTAINTY about this particular issue. Commented Sep 8, 2009 at 11:03
  • 1
    I've always thought the accidental instantiation argument (favoring singletons) was a bit fallacious. But it's the first time I read someone else with the same idea :-) Commented Sep 8, 2009 at 18:22
  • I' only add that there is sometimes a case around access to certain hardware that "doesn't play well with others" (I'm thinking of a certain company's telsets right now) /mutter mutter/ Commented Aug 17, 2010 at 22:34