Re: Function prefixes



Behdad Esfahbod wrote:
> > So I'm inclined to use "glc_" for libglocale.
>
> I was thinking about going the glib way.  glib is a set of three
> libraries, called gthread, gobject, and glib (everything else).
> They all use the "g_" as the first-level prefix.  gobject uses
> the "g_object_" prefix, gthread uses "g_thread_", and there are
> various subsystems in the catch-all library, like g_unicode_,
> g_key_file_, g_mainloop_, etc...
>
> So, my proposal is to use the giu_ prefix for all libraries
> developed as part of the giulia project, and use a second prefix
> to identify the subsystem and probably the header files and
> shared objects that the function is defined in.  I like the idea
> for it to look like an integrated set of libraries that share the
> same namespace, but completely isolated in there.

Well, I like just the opposite. "glc_" is unique, "giu_locale_" is
no advantage then. On the contrary, so long prefixes make source code
hardly readable, because the relevant informative part of identifiers
is drowned in always-constant boilerplate.

Also, I think global flexibility requirements will force us to move
components around in the long run, and thus "giu_" will in the long
run be barely more than a reminiscence of history.

> This reminds me that we need to settle on the header-file naming
> and installation scheme too.  This is a classic read:
>
>   http://www106.pair.com/rhp/parallel.html
>
> and the scheme is common in core GNOME libraries, with not much
> problem so far.

How probable will it be that our libraries will need to change in
incompatible ways? Maybe we can estimate that before the first release.
It's a long time till then... Until then, I'd just keep it in your TODO
list. And concentrate on the APIs now.

Bruno




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