Re: [gtk-list] Re: Gtk--: G_List quirks



Some Guy <guy@mikepery.pr.mcs.net> writes:

> I took your advice and checked out the bookmarks (nice page by the
> way, i'm still looking for that virus :),

(thanks - it only affects Windows users :-)

> iterators. The problem is, to use those advantages sometimes can
> produce code bloat, because of the heavy use of templates. I still
> think templates are evil, since if you use them for more than one
> data type you get a copy of all the functions for each data type
> used. Void*'s are much more handy for things like linked lists.

No, quite the contrary, templates are your friends. They are the
safest and most efficient way to achieve code reuse. void* is evil
because you have no type-safety. A slightly larger binary is less and
less a problem, a crashing binary that is extremely hard to debug is
always one.

> Back to the subject of G_List, it seems to me that if you can
> accomplish the "lptr = lptr->next" task with iterators, that
> G_List::next() and other functions don't need to increment the list,
> only give a sneak peek.

That's an option, but then they should be renamed to something a bit
more explicit (like peek_next()).

-- 
					Guillaume.
					http://www.worldnet.fr/~glaurent



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