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: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Wed, 20 Jun 2007 23:42:08 +0200
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