apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: New apr_poll() implementation was Re: [PATCH] speed up network timeout processing
Date Mon, 08 Jul 2002 17:23:10 GMT
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 :-)


View raw message