Re: [AD] Update on `const' |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2001-12-18, Lo'oRiS il Kabukimono <_lano_@xxxxxxxxxx> wrote:
> > char* get_filename(char* path);
>
> sorry if what i say sounds stupid, but i really never understood why
> a function that takes a read-write pointer should *also* return it.
> for me it sounds useless, and should be nicer if it returned something
> else (*) ... it there a reason (i mean a good reason :) for this behaviour?
`get_filename' doesn't modify its argument, therefore there's only one
reasonable thing it can return.
If you are talking about other functions, returning the dest parameter
is good because you can be lazy and compose things together in one
statement. Being lazy is good.