Re: [AD] Function parameter ordering conventions

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


On Wednesday 20 June 2007 23:27, Scott F wrote:
> Why put source before destination?
> 
> That's the opposite of "memcpy(dst, src, len)",
> "strcpy(dst, src)", and don't forget "dst = src".

... on the other hand, this is true. However, teh ordering in memcpy is 
very counter intuitive to me and I always look it up when I use memcpy. 
The reason is that I tend to read computer programs as much as natural 
language as possible, so I find it more natural to read the code as "copy 
<source> to <destination>". Essentially the same reason I prefere 
blit(bitmap,...) to bitmap.blit(...) any day of the week.

Either way, it will be personal preference and doing it consistent is the 
most important thing. There's no pleasing everyone.

Evert




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