Re: Quick question on Glib style/design
- From: Ryan McDougall <NQG24419 nifty com>
- To: muppet <scott asofyet org>
- Cc: gtk-devel-list gnome org
- Subject: Re: Quick question on Glib style/design
- Date: Wed, 04 Aug 2004 11:16:20 +0900
On Tue, 2004-03-08 at 07:46 -0400, muppet wrote:
[snip]
>
> but this is also, in general, Not A Good Thing as you have totally
> sidestepped the compiler's type checking. for example, image somebody
But to me it seems as if Glib totally side-stepped C type checking
anyways, since everything needs to be cast anyways.
> tries to pass a Flurble* to foo_bar() --- it will take quite a bit of
> swimming through headers to find that it's the wrong type (even with
> the void* declaration you described above), because the compiler will
> not complain at all about the bad type.
But thats true anyways since I can run foo_bar (FLURBLE(obj)) and it
will work just fine, no? And I don't think its overly confusing since
the type-cast is totally redundant information anyways:
g_collection_begin (COLLECTION (list))
states that this function only works on collections twice. Any
programmer would have to know that collection<-list.
>
> if you have
>
> void foo_bar (Foo * f);
>
> and you want to pass a Bar* to it, you are instantly reminded that the
> Bar needs to derive from a Foo. this is idiomatic to C and especially
> to GLib.
>
For the time being I won't change anything, but get back to doing some
real development.
Thanks to everyone who gave me such good info!!
Cheers,
Ryan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]