Re: [AD] Renaming of functions in kcm_audio addon |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] Renaming of functions in kcm_audio addon
- From: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Wed, 26 Nov 2008 08:37:48 -0500
On 26 Nov 2008, at 08:08, Peter Wang wrote:
We should probably rename al_current_time() and al_key_down()
as well.
Maybe it should be al_is_channel_configured() instead?
Doing a quick grep:
[...]
It looks like (modulo module prefixes) al_is_* is more popular.
On the other hand, if (al_channel_is_configured()) actually reads as
English. :P
Then again, so does al_is_channel_configured()?: ;)
Either way, it's easy to rename stuff (I hacked up a Perl script to
do it); just tell me what to rename to what (I'll do them in separate
commits though).
(Aside: al_is_compatible_bitmap() is different from the other
examples you posted in that it omits the hing that is being compared;
it would logically be al_bitmap_is_compatible_bitmap(), similar to
al_is_compatible_font()).
It's probably a good idea to have someone from the outside look
through the list of function names to pick out inconsistencies in the
naming scheme.
So
al_event_queue_is_empty -> al_is_event_queue_empty
al_timer_is_started -> al_is_timer_started
al_key_down -> al_is_key_down
And
al_current_time -> al_get_time
?
Seems fine to me. If we want to be verbose about it, it could be
al_get_current_time(), but I'm not sure that's needed (what other
time would we get? Tea time? Dinner time?)
I would be fine with exempting all al_get_...() functions from the
verb-requirement and leave out the _get - but we shouldn't have the
_get in some and not in others. Either
al_bitmap_width()/al_channel_count()/al_key_down() etc. for
everything, or al_get_...() for everything.
Yes.
Seconded.
Which doesn't tell us which it should be though. ;)
To borrow an example from the kcm_audio plugin:
al_get_stream_long -> al_stream_long to me seems a bit weird. It's
not obvious to me at first glance what al_stream_long() would do, as
al_bitmap_width() does (then again, I'm not that fond of the
_get_<object>_<type> API to begin with). So on that example if we
want consistent naming, I think it should be al_get_*.
Evert