Re: [AD] Function parameter ordering conventions

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


On 6/20/07, Trent Gamblin <trent@xxxxxxxxxx> wrote:
Elias and I were discussing how function parameters should be ordered
with the new API. I thought (and I think Elias agreed) that the order
function(src, src_params, dst, dst_params) is the most natural,

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.

While I agree that a consistent API is a necessity, I don't think that
means strictly following any noun/verb/object/adjective/interjection
order. We should give ourselves flexibility to deviate when some other
system is more commonly used for a given function.

Since this is Allegro, I think we should stick to Allegro 4.2
conventions in places that it's not incorrect. eg, I don't see any
reason to switch putpixel's parameters, but something like draw_sprite
is definitely out of order.

--
Matthew Leverton




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