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



Hi,

Le 8/5/2004, "PUYDT Julien" <julien puydt laposte net> a écrit:

>Hi,
>
>here are a few comments on the coding rules in the wiki, mostly the
>first half:
>* it enforces a gm_ prefix, while most of the code uses gnomemeeting_;
>in fact, I think we should perhaps use gnomemeeting_ for things in lib/,
>and gm_ for things in src/: the former are supposed to be gm-agnostic,
>and the last to be gm-specific (I think the latest code uses that
>convention already);

I prefer to use gm_ everywhere because it is shorter. Probably using
gnomemeeting_ was a bad idea.

>* the current code uses "GMObject" as key name, and not "GmObject" as
>the wiki says;

ok, just change that typing mistake in the wiki.

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

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

>I think there are two important dichotomies in gm's code:
>* lib/ vs src/: the first contains code that other project should be
>able to just copy as-is to use, the second contains code that is
>specific to gm: that is why I propose to prefix the functions with a
>clear gnomemeeting_ in the first case, while a simple gm_ should be
>enough in the second case;

gm_ everywhere or gnomemeeting_ everywhere

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

>Snark
>
>_______________________________________________
>Gnomemeeting-devel-list mailing list
>Gnomemeeting-devel-list gnome org
>http://mail.gnome.org/mailman/listinfo/gnomemeeting-devel-list



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