Re: [AD] Function parameter ordering conventions

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


I tend to agree with Matthew.

I think we should change only parameter orders in places where it tends
to be confusing or annoying. Don't change it just because it would look
more beautiful, natural speaking, OO, or anything like that. It should
look simply like allegro.

E.g.: No need to change putpixel() parameter orders to make it looks
like blit(), rotate_sprite(), play_sample(), memcpy() or some other
function with a very different purpose. On the other way, any
differeneces in similar groups of functions, like blit() vs.
draw_sprite() are indeed annoying and confusing, so in these cases we
should swap the parameters of some functions.

By the way, creating an al_put_pixel function which is just a 4.2
putpixel with swapped parameters just because it is more
beautiful/natural thinking/OO/whatever is bad, because people upgrading
existing programs to 4.9+, without wanting to use the compatibility
layer will need to rewrite some code and swap parameters just because
the API twisted them without a good reason. Lots of Al-4.2 people will
get problems if they forget to change parameter order when using
al_putpixel() instead of putpixel() (or any other function), and this
would indeed be frequent. So we should change the parameter order just
if we have a really good reason to do that (like avoiding confusion and
annoyances), even if the API parameters-order keeps a bit (a bit, not a
lot) inconsistent.

Victor Williams Stafusa da Silva

--- Trent Gamblin <trent@xxxxxxxxxx> escreveu:

> Matthew Leverton wrote:
> > putpixel(color, x,y) seems wrong to me, even if it does follow the
> > convention more closely than putpixel(x,y, color). Do a Google
> search
> > for putpixel functions and see how many place the color first.
> 
> I don't think we should be basing Allegro on some other API. We
> should 
> just do what is best, and I still think putpixel(color, x, y) is not 
> only more consistent, but reads better too. Sure, Allegro 4.2 uses 
> putpixel(x, y, color), but we want Allegro 5 to be better than
> Allegro 
> 4, right?
> 
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> -- 
> https://lists.sourceforge.net/lists/listinfo/alleg-developers
> 



       
____________________________________________________________________________________
Novo Yahoo! Cadê? - Experimente uma nova busca.
http://yahoo.com.br/oqueeuganhocomisso 




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