Singletons Are Evil Page Refactoring Notes

Moved from SingletonsAreEvil in Jan. 2005. The discussion below appears to have taken place in 2002.

Please note that this page [SingletonsAreEvil] is being slowly merged into SingletonPattern, and the idea is that I would like to refactor it away into nothingness. -- FrancisHwang

I hope you don't delete this page. This page is distinct from SingletonPattern because it expresses a peculiar, controversial judgement about singletons. I'm already disappointed that this page has been watered down from its rhetorically excessive former glory. Also, the SingletonPattern page has grown enormous. -- BenKovitz

Ben, the idea behind merging this page into SingletonPattern is that it contains a lot of interesting text that would be easier to find if it were either a) on the main page or b) on a page that were named after a topic, not an opinion. A page title like SingletonsAreEvil tells me they're evil, but not why. A page title like SingletonGlobalProblems tells me more. -- francis

I'm afraid I must disagree. The body of the text on SingletonsAreEvil can tell you why. A title like SingletonsAreEvil is a promise that the body will present an argument, and in hyperbolic style. I think duplicating ideas here and on other pages is fine. I point people to this page to demonstrate how opinionated programmers are and the moral terms in which they think. Please don't water down this page. Let there be fun! -- BenKovitz

Feb 11 2002: Moved text by PhilipEskelin to CppSingleton, lots of regroupings. Nothing added or deleted. -- FrancisHwang

Mar 18 2002: Regroupings, nothing added or deleted. -- francis

Apr 8 2002: Regroupings. (Hm, this refactoring would go more quickly if the stuff on this page didn't make me feel so dumb ...) -- francis

Apr 20 2002: Moved lots of text to SingletonPattern. -- francis

Francis, I just retrieved a relevant chunk of the 'double checked locking' page and stuffed it into the singleton page. It looks like most of the issues are in there now. I'm not sure whether it's best to condense the issues on the one page, or refactor them into lots of little pages which express each issue. I like the idea of the latter, but don't want to get in your way. Nice to see someone getting on with it. Cheers. :) -- RichardHenderson.


Thanks for the help.

The reason I'm doing this is because I don't think SingletonsAreEvil is a sufficiently distinct page title from SingletonPattern. I'd rather SplitByTopicNotByOpinion, so eventually we might have pages like SingletonCreation? and SingletonsAreGlobal?, or whatever. Moving everything to SingletonPattern is just an intermediate step. -- francis

Feb 20 2003: Moved text to SingletonPattern. -- francis

Wow, this is a very very bad refactoring. This used to be a page I could direct people to. Now, well, I guess I'll have to wait until you get rid of this page and then I'll make another one with the same title. So, Francis, you "don't think" it is a good idea to have this page. Perhaps, we should do some kind of poll. I'll bet I can drum up several hundred people that "do think" it is a good idea to have this page. One of the great values of the Wiki has been to have a place to discuss opinions. You are in the process of destroying that value. Perhaps, I'll move on as many others have. -- MikeCorum

Francis, I'm a great admirer of your work, but I think you've erred a little here; whilst the idea of "merging this page into SingletonPattern [because] it contains a lot of interesting text that would be easier to find" is a good one (information wants to be useful!), to "refactor it away into nothingness" would, I think, be an error. The name reflects an opinion which some people evidently hold, and which has attracted useful discussion; it's also a classic hackish way of naming the position. Perhaps the final form of the page should reflect its name: it should state the case and refer to problems with singletons (on their own pages) - with, if possible, a healthy dose of excessive rhetoric! -- TomAnderson

Plus then MikeCorum and (presumably) others would be able to direct people to a page for the specific problem they're referring to in each particular case (if they have a particular one in mind).

I'm sorry if other people think this is a bad refactoring. I thought I was doing the right thing, but then, I never claimed to be perfect. Allow me to state my concerns, and why I did what I did, and maybe we can come to a solution that keeps everybody happy.

If I remember the state of the singleton-related pages correctly in the past, there were actually three separate pages covering the topic in general: SingletonPattern, SingletonsAreGood, and SingletonsAreEvil. After a time of heavy discussion all three were quite big and sprawling, which leads to problems like:

So I figured that I could merge them all into the neutrally-named SingletonPattern, and spin off subtopics as necessary. I've done a similar thing on YouArentGonnaNeedIt, swallowing pages like YouArentGonnaNeedItDiscussion but spinning off pages like ElicitingRequirements, YagniAndDatabases, and DoesYagniInterruptFlow.

I'd also like to make it clear that my attempts at refactoring are in no way an attempt to rewrite the discussion to give the "Singletons are good" side the upper hand. I don't consider it a resolved issue. SingletonPattern is, to me, the best neutral title for this material to start at. Just because I'm advocating that we do away with the page title SingletonsAreEvil does not at all mean that I'm advocating we do away with that opinion.

But others are saying they found the page useful for expressing a certain sort of opinion. I think that's legitimate. Maybe they're seeing a form there that I couldn't see. From my memory, it looked a lot like the original SingletonPattern page. That page goes like this:

Singletons are good. No, they're not.

And I remember the original SingletonsAreEvil reading like this:

Singletons are evil. No, they're not.

So, maybe my question is, if we'd like to maintain SingletonsAreEvil as a separate page, is there something about the form that would distinguish it from SingletonPattern? Besides, I mean, just the opinion. -- francis

It would appear that the smart thing to do is to put the pros and cons in bullet points in SingletonPattern, then reference all discussion to a SingletonPatternDiscussion? page. This seems to be the trend in reducing clutter and duplication for other contentious issues. I'm trying to do some of this for the document and requirements pages; work is going slooooow. -- MartySchrader

So then would we delete this page? -- francis

Affimative. I imagine all the Singleton diatribe can be pared down to a single page, either as a pro/con DocumentMode thing or as a point/counterpoint "discussion" between two DramaticIdentity actors, a la DialecticMode. Eh?

I suggest restructuring thusly:

SingletonPatternTermAsCoined (eventually just replaced by a refactored SingletonPattern that respects its heritage).




SoloAntiPattern, CardinalityEnforcedInCode


EditText of this page (last edited February 23, 2006) or FindPage with title or text search