Re: [AD] Function parameter ordering conventions |
[ 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] Function parameter ordering conventions
- From: Andrei Ellman <ae-a-alleg@xxxxxxxxxx>
- Date: Thu, 21 Jun 2007 12:19:03 +0200
- Organization: Wacko Software
Trent Gamblin wrote:
For example al_put_pixel(color, dx, dy),
Don't like this ordering for put_pixel one bit, possibly because I've never
seen a put pixel function anywhere that used this ordering ever. If that's
right, I would recommend against deviating from the norm.
I would rather stay consistent with the rest of the API. If you're
calling "draw picture at x, y" why not "draw color at x, y"?
I consider a sprite to be an object and a colour to be an attribute.
As for paramater ordering, the way I'm used to is that the 'thing being
operated on' should be the first paramater (unless you're doing
C++-style coding in C, in which case, if you're coding a 'class-method',
the first paramater should be the 'this' pointer). However, with blit()
it would mean that dst_params would come first, which might make things
a bit messy/confusing.
In general, as long as we can make the API consistent, It does not
matter which comes first or last. As well as agreeing on the order, we
also need to agree on what is an object and what is an attribute.
AE.