Re: My thoughts on GRing
- From: Joshua N Pritikin <vishnu pobox com>
- To: Tim Janik <timj gtk org>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: My thoughts on GRing
- Date: Sat, 21 Dec 2002 23:54:34 +0530
On Sat, Dec 21, 2002 at 03:40:42AM +0100, Tim Janik wrote:
> On Thu, 14 Nov 2002, Owen Taylor wrote:
> > Is it worth the pain of deprecating GQueue and adding GRing?
> > I don't think so. Deprecation is expensive both in terms of:
> >
> > - Requiring people to change their code
> > - Confusing people until all vestiges of the deprecated method
> > are removed.
> >
> > I just don't see the benefits of GRing as being worth these
> > costs.
>
> you simply haven't been infected by it's convenience even over normal
> lists yet ;)
Yah. It's like this: The advantage of using NULL as a zero length list
is subtle but important. Simiarly, the advantages of rings over GList &
GQueue are also a little bit subtle.
> the two disadvantages i see for GRing over GList are:
> - GList is widely deployed and nailed in API where GRing isn't
But what is the _perfect_ data structure? GSList is perfect,
meaning that i can't imagine how to improve it significantly.
On the other hand, GQueue is clearly sub-optimal. The idealist
in me doesn't even want to touch GQueue.
> - you run code into endless loops if you do ring = ring->next instead
> of ring = ring_walk (ring, head) in a loop. however this should be
> easy to diagnose and fix (and i personally haven't run into this
> accident even once yet).
i actually made this mistake once. Yes, it was easy to recognize
and fix.
--
Victory to the Divine Mother!! after all,
http://sahajayoga.org http://why-compete.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]