Re: iterator resolution



> 
> 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.

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

--Karl 



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