|
Minor API inconsistencies |
Polybios
Member #12,293
October 2010
|
1) I have noticed some functions that are meant to query a boolean property are named al_is_* while some are called al_get_*. The ones that are called al_get_... without corresponding al_set_... colleagues are:
The ones with corresponding setters are:
2) Thus, the only function names that don't follow the al_verb_...-pattern are:
I thought I'd post it here for comments. By the way: The prototype for al_do_multiline_text is mysteriously absent from the docs page. How do I resurrect it? |
SiegeLord
Member #7,827
October 2006
|
Thanks for going through those! Some of those are indeed poorly named, and could stand for a revision. I think we'll be able to start deprecating some of the worst names in the next stable release. I've added this thread to my TODO list. Polybios said: Edit: Nevermind, the culprit was a space in addons/font/text.c:544. This is now fixed. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Yodhe23
Member #8,726
June 2007
|
Talking of inconsistencies... al_fgets(file,buffer,size) different to fgets(buffer,size,file) ?? www.justanotherturn.com |
Thomas Fjellstrom
Member #476
June 2000
|
Because we didn't want to clone the original libc api. Its more important for allegro's api to be consistent with itself than with similar external APIs. Allegro tends to go with the object it is operating on as the first parameter. -- |
Chris Katko
Member #1,881
January 2002
|
Thomas Fjellstrom said: Because we didn't want to clone the original libc api. While that's true, it's slightly confusing we copy the function name, but not the argument ordering. -----sig: |
jmasterx
Member #11,410
October 2009
|
Maybe a macro would be useful: #define al_fgets_t(b,s,f) al_fgets(f,b,s)
Agui GUI API -> https://github.com/jmasterx/Agui |
|