[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macros

From: Nicola Pero
Subject: Re: macros
Date: Fri, 23 Feb 2001 00:35:34 +0000 (GMT)

    ian> why do so many people use the RELEASE(foo) and
    ian> AUTORELEASE(foo) macros instead of just typing out [foo
    ian> release] or [foo autorelease] ?  they do the same thing, but
    ian> i just fail to see the logic in using the macro.

The macros have a single main advantage - 

they make the code simpler/better to port to a garbage-collected
environment.  GNUstep base library can run with a garbage-collector
(Apple stuff can't).  We hope to be able to run the rest of the
libraries (gui, xgps, xdps) too with a garbage collector at some point
in the future.

Whether you care or not about garbage-collection, the fact is that
RELEASE will make your code better when ported to garbage-collected
environment.  That's a good thing.

Btw - I personally like ASSIGN a lot - so that I suggest using it even
if you are 100% sure your code will never run under the
garbage-collector.  It saves typing AND simplifies the logic of memory
management ==> prevents stupid memory management typos/bugs.  It also
helps in porting the code to garbage-collected environment, so why not
using it.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]