Re: [GnomeMeeting-devel-list] Comments on the coding rules in the wiki



On sam, 2004-05-08 at 14:21, Damien Sandras wrote:
> I prefer to use gm_ everywhere because it is shorter. Probably using
> gnomemeeting_ was a bad idea.

Nice. Now that is something people could help with ;-)

> >* the current code uses "GMObject" as key name, and not "GmObject" as
> >the wiki says;
> 
> ok, just change that typing mistake in the wiki.

Changes to coding rules that apply project-wise should probably be done
by a single person.

> >* it enforces the gm_ prefix for both public and static functions: I
> >would rather have publicly available functions with a prefix, and static
> >functions without prefix, to know which can be changed with a local
> >impact, and which have a more global impact;
> 
> I disagree with this. It is a matter of "do you prefer black or white",
> so it is not even worth discussing it.

Ok.

> >* it enforces passing the GtkWidget* and not the internal structure for
> >both internal(static) and public functions: why add a g_object_get_data
> >in all the static functions, while they are internal!? The static
> >functions&callbacks are defined, visible and used behind the wall that
> >hides the internal structure: they should get it directly.
> 
> Simply to have the same behavior everywhere. Having one type of function
> doing one thing and another type of functions doing things in another
> way is misleading and confusing.

It is neither misleading nor confusing: the functions that are available
'outside', _have to use_ the GtkWidget*, because that's the only thing
the rest of gnomemeeting can use to communicate with them, and the first
thing they do is calling g_object_get_data to have the information they
really care for. The static functions have no good reason to get the
GtkWidget*.

If they must _all_ get the same thing, then that should be the only
thing that matters: the internal structure. The main widget is just
there to make things easy for memory management.

> >* internal vs public functions/callbacks: the rest of gm only knows a
> >GtkWidget*, and has only that information to give to the public
> >functions. So the public functions should all get that GtkWidget* in
> >some way or another. But all the internal functions are... internal, and
> >hence, will only use the internal structure: they should get it by
> >default, and not the GtkWidget* that they don't care about anyway.
> >
> 
> I don't find it very clean...

I don't find passing the GtkWidget* to 30 functions when only two really
have to is sane.

I seem to remember we're not the only code contributors ; I'm sure
things would get clearer if some others could give an opinion too!

Snark




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