Re: bonobo_object_ref



Ettore Perazzoli <ettore@helixcode.com> writes:

> > I really hate code which does this:
> > 
> > do_something (bonobo_object_ref (obj));
> 
> This is bad indeed, but it does not happen often.
> 
> What happens all the time is that you want to save the value of the
> pointer somewhere, and at the same time add a reference to it (as you
> correctly need to do). So the case we are attacking here is:
> 
> 	var = obj;
> 	bonobo_object_ref (obj);
> 
> which becomes
> 
> 	var = bonobo_object_ref (obj);
> 
> The latter is definitely clearer.
> 

I do not think this is a lot clearer. If the point is only saving
lines, you can already do

bonobo_object_ref (var = obj);


of course this os ugly as hell.

 - Maciej




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