Re: GC pros and cons
Re: GC pros and cons
- Subject: Re: GC pros and cons
- From: Andy Lee <email@hidden>
- Date: Thu, 25 Jun 2009 14:11:56 -0400
On Thursday, June 25, 2009, at 12:06PM, "Philip Aker" <email@hidden> wrote:
>> I can appreciate having an elevated sense of responsibility, but if
>> you take this to the extreme you'd insist on programming in assembly
>> because you don't trust compilers to properly put things on the
>> stack on entering a function and remove them on exiting. I suppose
>> you trust malloc() and free()? But you're trusting those to do a
>> lot of stuff behind the scenes as well (like glomming together
>> contiguous blocks of free memory) -- and you're trusting yourself to
>> balance them properly.
>
>That's a good point but I see that Hamish Allan has a rather effective
>counter in trusting a 10 year old ISO/IEC standard.
He said he *would* trust a compiler that conforms to that standard.
He went on to agree that it's silly to treat GC as inherently irresponsible.
He was pointing out that nothing's perfect. (Sorry, Hamish, if I'm putting words in your mouth.)
>From your standpoint, it's only an effective counter if you call my bluff and tell me you really do only program in assembly, because trusting a compiler to be C99-compliant enough to push arguments on the stack is like firing a shotgun into a crowd.
>> As we adopt higher-level languages, we trust them to do things for
>> us so that we're freed to think at higher levels of abstraction.
>
>Perhaps we should discuss your definitions of being free and "higher
>levels of abstraction" and whether or not they have merit?
Perhaps we should discuss your definiton of "merit" first. :) I don't think I used the terms vaguely or ambiguously. I think I used them in a way most programmers would understand in this context.
>> The current implementation of GC in Objective-C may not reach a high
>> enough level of trust for you, but to rule out GC as inherently
>> irresponsible is kind of silly IMHO.
>
>I haven't ruled it out and if we could judge by Apple's behavior in
>the past, I may not have any choice in the near future.
As long as you do have a choice, I don't see you how can possibly not rule it out based on your own arguments.
>>> In a nutshell, for folks like me who regularly use CFCreate …
>>> CFRelease in loops, what are the benefits of GC?
>
>> I think it's pretty obvious what the benefits are: not having to
>> manually manage memory, which eliminates one class of bugs and frees
>> up time and mental effort so you can concentrate on avoiding and
>> fixing other classes of bugs. I'm not sure if you were expecting
>> more than the obvious?
>
>I think it's because I value consistency throughout more than
>shortcuts available for technologies A and B, but not for technologies
>C and D.
Fair enough, but from this it sounds like you already know very well -- perhaps better than most -- what the pros and cons of GC are, in general and as implemented in Objective-C 2.0, sufficiently to decide for yourself whether to use it.
>Anyway thanks, that was certainly a thought provoking reply,
Ditto. :)
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden