• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is Apple's singleton sample code correct?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Apple's singleton sample code correct?


  • Subject: Re: Is Apple's singleton sample code correct?
  • From: David Gimeno Gost <email@hidden>
  • Date: Thu, 1 Dec 2005 22:23:27 +0100

On 1 Dec 2005, at 18:43, Greg Titus wrote:

You seem to be building a lot of complexity for a use case that I've never run into in my 16 years of professional programming. Do you have an example of resource cleanup dependencies that necessitates this kind of solution?

I was just following up on a subthread that was discussing these issues. I didn't start that subthread nor would I ever have started it because I already knew that it would contribute a lot of noise. I just wanted to fill in the holes for those who might be interested. You're not interested? Fine. I myself have no interest in pursuing this issue any further either.

All that complexity comes from the lack of appropriate runtime support in the language. In any other OO language with such supporting mechanisms you wouldn't even have to think about it. You would just use "smart pointers" or let the garbage collector do its job, or something like that. I bet you don't see a need for adding garbage collection (as an option) to Objective-C, either. Fine. Go and tell Apple to stop wasting resources on it then, rather than arguing with me.

And btw, yes, there are other resources you haven't considered, such as hardware devices and database connections.

What is the problem you are attempting to solve here?

To make it clear that Apple's singleton sample code is broken, that there is no trade-off that justifies a singleton to be written that way.

Thanks,

You're welcome.

Regards.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Is Apple's singleton sample code correct?
      • From: "John C. Randolph" <email@hidden>
References: 
 >Re: Is Apple's singleton sample code correct? (From: David Gimeno Gost <email@hidden>)
 >Re: Is Apple's singleton sample code correct? (From: Greg Titus <email@hidden>)

  • Prev by Date: Re: Drawing a rectangular matrix of circles - an NSMatrix?
  • Next by Date: Re: Is Apple's singleton sample code correct?
  • Previous by thread: Re: Is Apple's singleton sample code correct?
  • Next by thread: Re: Is Apple's singleton sample code correct?
  • Index(es):
    • Date
    • Thread