Re: iterator resolution



On Sat, 4 Mar 2000, Karl Nelson wrote:

> > 
> > why bother at all?
> > what's wrong about
> > 
> > struct _*Iter
> > {
> >   /*< private >*/
> >   guint cache_count;
> >   gpointer buffer;
> >   [...]
> > };
> >
> > in the public header file?
> 
> Because it would inevitably be ignored.  How many people use the 
> g_list_next functions as opposed to glist->next?  Some people
> seem to think the little speed gained over using direct access
> is worth it.  That then ties the implementation down so that 
> if someone has an idea how to do it better later we are stuck
> with "we can't change this as someone depends on it."  Of course,
> I don't have much simpathy for those who directly access private
> structures (though I do it myself in a pinch).  Not giving them
> any way to do it easily will make that much less tempting.

there's a significant difference here,
GList.next is *not* declared private.

if we declare soemthing private, programmers usually honour
that information. there's no need to cripple header files
just because we don't trust people following our
recommendations.

> But on second thought, leaving the dumb names will at least
> break those bad users compiles when the arrangement of dummy
> names change.  
> 
> --Karl 
> 

---
ciaoTJ



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