Re: [AD] al_verb_noun

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, Feb 1, 2009 at 11:45 PM, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> I spotted a few (new?) cases where the function names seem to deviate
> from the guidelines:
>
I was going to comment on this (in general) at some point... What's
the convention for add-ons? Is any module qualifier going to be used?
If not, then we need to be careful to qualify all potentially
ambiguous functions.

Some add-ons (color, font) have module prefixes, but others don't
(kcm, primitives).

For example:

ALLEGRO_STREAM *stream = al_create_stream( ... );

In the current context, we know what that means. But what if we
introduce file streams or network streams? This is especially
important for closely integrated add-ons.

So perhaps that becomes:

ALLEGRO_AUDIO_STREAM *stream = al_audio_create_stream( ... );
al_audio_play_sample ( ALLEGRO_AUDIO_SAMPLE )

Or

ALLEGRO_AUDIO_STREAM *stream = al_create_audio_stream( ... );
al_play_audio_sample ( ALLEGRO_AUDIO_SAMPLE )

I prefer the latter version, but that means each function of every
add-on needs to be carefully considered. The former version is more of
a lazy way to resolve naming collisions.

I think there is a tendency to not prefix anything that has its roots
in A4, while prefixing other "new" add-ons with the modules. But I
don't think that's a good way to draw the line.

As more people start using the 4.9 series, the more important it
becomes to try to at least figure out the basic naming conventions
among the modules. I think the biggest issue to address is that of
add-on module prefixes. If it's not all-or-nothing, then there needs
to be a well defined method of determining it.


--
Matthew Leverton




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/