Re: gtk_label_get_text() string duping



Tim Janik <timj@gtk.org> writes: 
> doing *nothing* about this issue is definitely the worst choice,
> irregardless of what justifications are presented for inaction.
> 

I'm not saying do nothing, I'm saying we have already been acting for
a long time, over a year, and changing the solution we advocate after
all that time is going to be major pain. We have already solved the
problem, maybe it was the wrong solution, but it's too late to change.

i.e. for the last year or so I thought we were solving this problem by
making all new code return a copy, and there's a _bunch_ of code that
does that. Maybe not all code, but GConf, Pango, and Bonobo definitely
return copies from get_*() functions. So the authors of all that code
thought we had the convention "return a copy." And we've been telling
people on mailing lists and in docs that that's the convention.

There's a ton of libraries and apps to change in CVS, and you get zero
assistance from the compiler in doing so.

Since we have been using this solution for a year, it's pretty hard to
change now. In fact I bet it's at least several weeks of work, and
would leave a lot of leftover bugs since broken code will always still
compile without warnings. It's a bad idea to spend these few weeks on
something that will confuse everyone, create bugs, break APIs, etc.
The advantage just isn't large enough.

I don't think changing GTK only and leaving everything else different
is a very good idea. One of the great things about the GNOME codebase
is that it's pretty consistent in coding conventions, and that makes
it all a lot more maintainable.

If we make a change, maybe make "get" mean "make a copy", and come up
with another name to mean "return a reference". That way all the
existing "get" code continues to work.

Havoc




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