You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2002/07/08 19:23:10 UTC

Re: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing

At 11:47 AM 7/7/2002, Aaron Bannert wrote:
>On Sat, Jul 06, 2002 at 12:11:59PM -0700, Ryan Bloom wrote:
> > I vote to fix the API so that these kinds of mistakes can't happen in
> > the future.
>
>+1, let's fix the API now. (I also strongly dislike input/output parameters.)

Microsoft's Win32 API was built on IN,OUT arguments.  They are confusing,
you lose the original value ... when you needed to hang on to it you needed
to copy to another variable before you invoked the call.  It is much simpler
to deal with the other case;

int somefunc(int inarg, int *outarg)

and pass

somefunc (foo, &foo)

when you don't care about the original value.

Since they have become far more OO/IDL/COM/.NET centric, very, very few
new functions are introduced as [IN,OUT], most are IN foo, OUT bar instead.

They learned from their mistake, so should we :-)

Bill