You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@newton.ch.collab.net> on 2002/04/12 20:00:03 UTC
useless return values for apr_md5_*() functions...
I'm planning to make the following functions return void instead of
apr_status_t:
apr_md5_init()
apr_md5_update()
apr_md5_final()
apr_md5_encode()
apr_md5() /* this one will get the obvious code tweak too */
They currently can only return success anyway, and it's hard to
conceive of an implementation that would do otherwise.
If any APR developer knows a reason not to make this change, please
speak now or forever hold your peace... :-) (I'll wait a day.)
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Justin Erenkrantz <je...@apache.org>.
On Fri, Apr 12, 2002 at 03:13:18PM -0500, Karl Fogel wrote:
> "Bill Stoddard" <bi...@wstoddard.com> writes:
> > -1 (not a veto)
> >
> > With the release of a major application (Apache 2.0), the APR API should not change unless
> > there is a compelling reason. This is not a compelling reason.
>
> Sure, it can wait, no problem.
>
> However, I can see how this situation might start to get painful for
> APR developers, as more and more applications use APR. Apache 2.0 is
> just one of N dependents; is there some reason Apache's release
> process should affect the rate of APR development for everyone?
>
> If Apache needs a less turbulent APR during release, perhaps it would
> make sense to branch APR, so Apache developers can control which
> changes affect them during that period. The trunk could continue as
> before.
>
> Thoughts?
My take is that there is no reason not to have a return code
even if our current implementation always returns APR_SUCCESS.
We often encounter problems in APIs because we need a return
code when the prototype doesn't have it. It's easier to add
a return code when the prototype has it already rather than
add it when the prototype returns void. -- justin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Justin Erenkrantz <je...@apache.org>.
On Fri, Apr 12, 2002 at 03:13:18PM -0500, Karl Fogel wrote:
> "Bill Stoddard" <bi...@wstoddard.com> writes:
> > -1 (not a veto)
> >
> > With the release of a major application (Apache 2.0), the APR API should not change unless
> > there is a compelling reason. This is not a compelling reason.
>
> Sure, it can wait, no problem.
>
> However, I can see how this situation might start to get painful for
> APR developers, as more and more applications use APR. Apache 2.0 is
> just one of N dependents; is there some reason Apache's release
> process should affect the rate of APR development for everyone?
>
> If Apache needs a less turbulent APR during release, perhaps it would
> make sense to branch APR, so Apache developers can control which
> changes affect them during that period. The trunk could continue as
> before.
>
> Thoughts?
My take is that there is no reason not to have a return code
even if our current implementation always returns APR_SUCCESS.
We often encounter problems in APIs because we need a return
code when the prototype doesn't have it. It's easier to add
a return code when the prototype has it already rather than
add it when the prototype returns void. -- justin
Re: useless return values for apr_md5_*() functions...
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Stein <gs...@lyra.org> writes:
> So my answer for this particular patch is:
>
> * -1 for now(*), pending introduction of the versioning
>
> * add a ref to the patch to the STATUS file for tracking
>
> * when versioning is doc'd and implemented, then we add it
>
> * httpd must specify *WHICH* version of APR(UTIL) that it wants; it is not
> allowed to freeze the APR(UTIL) interfaces forever. Thus, it will say
> something like 1.x as a requirement. Based on the vsn rules, it will
> always be compat with that. at some point, it may need to say 1.x where
> x >= 2 if it starts using new APIs which get intro'd in APR 1.2.
+1 on all of the above, sounds sane to me.
-K
Re: useless return values for apr_md5_*() functions...
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Stein <gs...@lyra.org> writes:
> So my answer for this particular patch is:
>
> * -1 for now(*), pending introduction of the versioning
>
> * add a ref to the patch to the STATUS file for tracking
>
> * when versioning is doc'd and implemented, then we add it
>
> * httpd must specify *WHICH* version of APR(UTIL) that it wants; it is not
> allowed to freeze the APR(UTIL) interfaces forever. Thus, it will say
> something like 1.x as a requirement. Based on the vsn rules, it will
> always be compat with that. at some point, it may need to say 1.x where
> x >= 2 if it starts using new APIs which get intro'd in APR 1.2.
+1 on all of the above, sounds sane to me.
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Greg Stein <gs...@lyra.org>.
On Sat, Apr 13, 2002 at 12:59:26AM +0200, Sander Striker wrote:
>...
> - The GA release of Apache _should_ not restrain APR from doing API changes.
> Sure, we can't go changing stuff at random to match which way the wind blows,
> but until APR goes 1.0 we should certainly be able to change the API IMO.
I'm hoping to find time to write up the versioning stuff that we hashed out
<whenever>, based on the apr_version.h header. Based on that information, we
will define a specific version and say that Apache httpd uses that version.
If we want to make changes to the API, then we will do so under the
constraints of the version numbering imposed by that system.
[ in short: X.Y.Z. changes in Z are backwards/forwards binary compatible;
they are merely bug fixes, no API change at all. changes in Y introduce
new APIs, possibly macros to map an old API into a new one once it gets
compiled; binary compat is retained moving forward only (something linked
against 2.1.x will work with 2.2.x, but not vice versa). changes in X
require changes to be made in the application; deprecated APIs may be
removed, signatures changed, etc. ]
> - Since the return values are always APR_SUCCESS for the md5 functions
> and it is _very_ unlikely that an implementation will need a return value,
> this is a valid change.
I think it is a lot further past "valid". See Karl's email for a *very*
lucid description of why this change should occur.
However, I think we can easily defer it until we have the rules fully
described for the APR Projects (plural). We'll introduce this API change
under those new rules.
So my answer for this particular patch is:
* -1 for now(*), pending introduction of the versioning
* add a ref to the patch to the STATUS file for tracking
* when versioning is doc'd and implemented, then we add it
* httpd must specify *WHICH* version of APR(UTIL) that it wants; it is not
allowed to freeze the APR(UTIL) interfaces forever. Thus, it will say
something like 1.x as a requirement. Based on the vsn rules, it will
always be compat with that. at some point, it may need to say 1.x where
x >= 2 if it starts using new APIs which get intro'd in APR 1.2.
Cheers,
-g
(*) in this case, -1 is a veto. I hate Bill's use of -1 as a vote. He should
have used -0.5 to signify that he strongly dislikes it, but is not
vetoing. It is insane to always have to qualify what -1 means because
people change its definition.
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Greg Stein <gs...@lyra.org>.
On Sat, Apr 13, 2002 at 12:59:26AM +0200, Sander Striker wrote:
>...
> - The GA release of Apache _should_ not restrain APR from doing API changes.
> Sure, we can't go changing stuff at random to match which way the wind blows,
> but until APR goes 1.0 we should certainly be able to change the API IMO.
I'm hoping to find time to write up the versioning stuff that we hashed out
<whenever>, based on the apr_version.h header. Based on that information, we
will define a specific version and say that Apache httpd uses that version.
If we want to make changes to the API, then we will do so under the
constraints of the version numbering imposed by that system.
[ in short: X.Y.Z. changes in Z are backwards/forwards binary compatible;
they are merely bug fixes, no API change at all. changes in Y introduce
new APIs, possibly macros to map an old API into a new one once it gets
compiled; binary compat is retained moving forward only (something linked
against 2.1.x will work with 2.2.x, but not vice versa). changes in X
require changes to be made in the application; deprecated APIs may be
removed, signatures changed, etc. ]
> - Since the return values are always APR_SUCCESS for the md5 functions
> and it is _very_ unlikely that an implementation will need a return value,
> this is a valid change.
I think it is a lot further past "valid". See Karl's email for a *very*
lucid description of why this change should occur.
However, I think we can easily defer it until we have the rules fully
described for the APR Projects (plural). We'll introduce this API change
under those new rules.
So my answer for this particular patch is:
* -1 for now(*), pending introduction of the versioning
* add a ref to the patch to the STATUS file for tracking
* when versioning is doc'd and implemented, then we add it
* httpd must specify *WHICH* version of APR(UTIL) that it wants; it is not
allowed to freeze the APR(UTIL) interfaces forever. Thus, it will say
something like 1.x as a requirement. Based on the vsn rules, it will
always be compat with that. at some point, it may need to say 1.x where
x >= 2 if it starts using new APIs which get intro'd in APR 1.2.
Cheers,
-g
(*) in this case, -1 is a veto. I hate Bill's use of -1 as a vote. He should
have used -0.5 to signify that he strongly dislikes it, but is not
vetoing. It is insane to always have to qualify what -1 means because
people change its definition.
--
Greg Stein, http://www.lyra.org/
Re: useless return values for apr_md5_*() functions...
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Bill Stoddard" <bi...@wstoddard.com> writes:
> Breaking API compatability is not something that should be taken
> lightly. This is an issue with all users of APR, not just the http
> server. I am not against the API changing if there is a compelling
> reason for it. This change is light-years from compelling.
Well, now, I don't know if it's all that many light years... :-)
IMHO, this is essentially a documentation bug.
The return codes are confusing to callers. Someone computing MD5 is
likely to wonder what the heck could possibly go wrong, since in
theory *nothing* can go wrong. Checksum computation on arbitrary data
has to be foolproof, assuming the buffer is long enough. Being able
to return an error from the computation is equivalent to having a bug
in the checksumming code, really. And instead of returning error, we
would just fix the bug.
So the presence of the return values sends the developer into the
source code to see why there is this puzzling possibility of error.
Whereupon he discovers that things are exactly as he suspected -- the
functions really *can't* return any errors.
Well, if they can't return errors, the calling code certainly doesn't
need to check the return values, and so he writes code that tosses the
return values. Or he doesn't. Either way is bad.
Now the next person comes along. She sees the code, maybe has seen
other code that uses the same interface, and wonders why one place
checks the return values and the other doesn't.
She makes the same inspection. Or, she asks on the list. Now a bunch
of people go diving into the sources, and discover the same thing...
You get the idea. A lot of wasted time and mental energy.
Offering an error code from an operation that can't possibly error is
not doing anyone a favor. It's confusing, and leads to inconsistent
calling code. (Not to mention that for those who trust the .h file
blindly, their code gets cluttered with error checks that they don't
need to be doing.)
Is it a major bug? No.
Should it be fixed? Yes, I certainly think so. IMHO, this is not
"light-years from compelling", it's something that needs to get done
eventually, to avoid wasting people's time.
> Breaking API compatability is not something that should be taken
> lightly.
Not at all -- light breaking *can* be taken lightly, because it's not
going to make much work for people. Serious breaking should be taken
more seriously, of course, but this isn't that kind of change.
"Serious" breaking would be adding arguments to a function, or
changing types, because that makes real work -- people have to prepare
objects that they didn't have to prepare before. But getting rid of a
return value? It just means people get some perfectly clear compiler
warnings, and remove some error checks to fix them.
That's hardly an onerous burden, I think. :-)
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Bill Stoddard" <bi...@wstoddard.com> writes:
> Breaking API compatability is not something that should be taken
> lightly. This is an issue with all users of APR, not just the http
> server. I am not against the API changing if there is a compelling
> reason for it. This change is light-years from compelling.
Well, now, I don't know if it's all that many light years... :-)
IMHO, this is essentially a documentation bug.
The return codes are confusing to callers. Someone computing MD5 is
likely to wonder what the heck could possibly go wrong, since in
theory *nothing* can go wrong. Checksum computation on arbitrary data
has to be foolproof, assuming the buffer is long enough. Being able
to return an error from the computation is equivalent to having a bug
in the checksumming code, really. And instead of returning error, we
would just fix the bug.
So the presence of the return values sends the developer into the
source code to see why there is this puzzling possibility of error.
Whereupon he discovers that things are exactly as he suspected -- the
functions really *can't* return any errors.
Well, if they can't return errors, the calling code certainly doesn't
need to check the return values, and so he writes code that tosses the
return values. Or he doesn't. Either way is bad.
Now the next person comes along. She sees the code, maybe has seen
other code that uses the same interface, and wonders why one place
checks the return values and the other doesn't.
She makes the same inspection. Or, she asks on the list. Now a bunch
of people go diving into the sources, and discover the same thing...
You get the idea. A lot of wasted time and mental energy.
Offering an error code from an operation that can't possibly error is
not doing anyone a favor. It's confusing, and leads to inconsistent
calling code. (Not to mention that for those who trust the .h file
blindly, their code gets cluttered with error checks that they don't
need to be doing.)
Is it a major bug? No.
Should it be fixed? Yes, I certainly think so. IMHO, this is not
"light-years from compelling", it's something that needs to get done
eventually, to avoid wasting people's time.
> Breaking API compatability is not something that should be taken
> lightly.
Not at all -- light breaking *can* be taken lightly, because it's not
going to make much work for people. Serious breaking should be taken
more seriously, of course, but this isn't that kind of change.
"Serious" breaking would be adding arguments to a function, or
changing types, because that makes real work -- people have to prepare
objects that they didn't have to prepare before. But getting rid of a
return value? It just means people get some perfectly clear compiler
warnings, and remove some error checks to fix them.
That's hardly an onerous burden, I think. :-)
-Karl
RE: useless return values for apr_md5_*() functions...
Posted by Sander Striker <st...@apache.org>.
> From: Bill Stoddard [mailto:bill@wstoddard.com]
> Sent: 12 April 2002 22:43
> -----
> > "Bill Stoddard" <bi...@wstoddard.com> writes:
> > > -1 (not a veto)
> > >
> > > With the release of a major application (Apache 2.0), the APR API should not change
> unless
> > > there is a compelling reason. This is not a compelling reason.
> >
> > Sure, it can wait, no problem.
> >
> > However, I can see how this situation might start to get painful for
> > APR developers, as more and more applications use APR. Apache 2.0 is
> > just one of N dependents; is there some reason Apache's release
> > process should affect the rate of APR development for everyone?
>
> Breaking API compatability is not something that should be taken lightly. This is an
> issue with all users of APR, not just the http server. I am not against the API changing
> if there is a compelling reason for it. This change is light-years from compelling.
>
> Bill
A few points:
- The GA release of Apache _should_ not restrain APR from doing API changes.
Sure, we can't go changing stuff at random to match which way the wind blows,
but until APR goes 1.0 we should certainly be able to change the API IMO.
- Since the return values are always APR_SUCCESS for the md5 functions
and it is _very_ unlikely that an implementation will need a return value,
this is a valid change. Or at least something to think about. I honestly
don't think there is any code out there checking the return values. Therefor
the change shouldn't affect to many 'users'. However, as Justin pointed out
it is easier to have an API you can make up new return values than having one
with no return values. This seems to be the general policy within APR:
have the API have return values. Even if your implementation always returns
APR_SUCCESS. With this in mind, I second Bill and Justin and like to cast
a negative vote when it comes to changing the md5 API.
Just my $0.02,
Sander
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
RE: useless return values for apr_md5_*() functions...
Posted by Sander Striker <st...@apache.org>.
> From: Bill Stoddard [mailto:bill@wstoddard.com]
> Sent: 12 April 2002 22:43
> -----
> > "Bill Stoddard" <bi...@wstoddard.com> writes:
> > > -1 (not a veto)
> > >
> > > With the release of a major application (Apache 2.0), the APR API should not change
> unless
> > > there is a compelling reason. This is not a compelling reason.
> >
> > Sure, it can wait, no problem.
> >
> > However, I can see how this situation might start to get painful for
> > APR developers, as more and more applications use APR. Apache 2.0 is
> > just one of N dependents; is there some reason Apache's release
> > process should affect the rate of APR development for everyone?
>
> Breaking API compatability is not something that should be taken lightly. This is an
> issue with all users of APR, not just the http server. I am not against the API changing
> if there is a compelling reason for it. This change is light-years from compelling.
>
> Bill
A few points:
- The GA release of Apache _should_ not restrain APR from doing API changes.
Sure, we can't go changing stuff at random to match which way the wind blows,
but until APR goes 1.0 we should certainly be able to change the API IMO.
- Since the return values are always APR_SUCCESS for the md5 functions
and it is _very_ unlikely that an implementation will need a return value,
this is a valid change. Or at least something to think about. I honestly
don't think there is any code out there checking the return values. Therefor
the change shouldn't affect to many 'users'. However, as Justin pointed out
it is easier to have an API you can make up new return values than having one
with no return values. This seems to be the general policy within APR:
have the API have return values. Even if your implementation always returns
APR_SUCCESS. With this in mind, I second Bill and Justin and like to cast
a negative vote when it comes to changing the md5 API.
Just my $0.02,
Sander
Re: useless return values for apr_md5_*() functions...
Posted by Bill Stoddard <bi...@wstoddard.com>.
-----
> "Bill Stoddard" <bi...@wstoddard.com> writes:
> > -1 (not a veto)
> >
> > With the release of a major application (Apache 2.0), the APR API should not change
unless
> > there is a compelling reason. This is not a compelling reason.
>
> Sure, it can wait, no problem.
>
> However, I can see how this situation might start to get painful for
> APR developers, as more and more applications use APR. Apache 2.0 is
> just one of N dependents; is there some reason Apache's release
> process should affect the rate of APR development for everyone?
Breaking API compatability is not something that should be taken lightly. This is an
issue with all users of APR, not just the http server. I am not against the API changing
if there is a compelling reason for it. This change is light-years from compelling.
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Bill Stoddard <bi...@wstoddard.com>.
-----
> "Bill Stoddard" <bi...@wstoddard.com> writes:
> > -1 (not a veto)
> >
> > With the release of a major application (Apache 2.0), the APR API should not change
unless
> > there is a compelling reason. This is not a compelling reason.
>
> Sure, it can wait, no problem.
>
> However, I can see how this situation might start to get painful for
> APR developers, as more and more applications use APR. Apache 2.0 is
> just one of N dependents; is there some reason Apache's release
> process should affect the rate of APR development for everyone?
Breaking API compatability is not something that should be taken lightly. This is an
issue with all users of APR, not just the http server. I am not against the API changing
if there is a compelling reason for it. This change is light-years from compelling.
Bill
Re: useless return values for apr_md5_*() functions...
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Bill Stoddard" <bi...@wstoddard.com> writes:
> -1 (not a veto)
>
> With the release of a major application (Apache 2.0), the APR API should not change unless
> there is a compelling reason. This is not a compelling reason.
Sure, it can wait, no problem.
However, I can see how this situation might start to get painful for
APR developers, as more and more applications use APR. Apache 2.0 is
just one of N dependents; is there some reason Apache's release
process should affect the rate of APR development for everyone?
If Apache needs a less turbulent APR during release, perhaps it would
make sense to branch APR, so Apache developers can control which
changes affect them during that period. The trunk could continue as
before.
Thoughts?
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Bill Stoddard" <bi...@wstoddard.com> writes:
> -1 (not a veto)
>
> With the release of a major application (Apache 2.0), the APR API should not change unless
> there is a compelling reason. This is not a compelling reason.
Sure, it can wait, no problem.
However, I can see how this situation might start to get painful for
APR developers, as more and more applications use APR. Apache 2.0 is
just one of N dependents; is there some reason Apache's release
process should affect the rate of APR development for everyone?
If Apache needs a less turbulent APR during release, perhaps it would
make sense to branch APR, so Apache developers can control which
changes affect them during that period. The trunk could continue as
before.
Thoughts?
-Karl
Re: useless return values for apr_md5_*() functions...
Posted by Bill Stoddard <bi...@wstoddard.com>.
-1 (not a veto)
With the release of a major application (Apache 2.0), the APR API should not change unless
there is a compelling reason. This is not a compelling reason.
Bill
> I'm planning to make the following functions return void instead of
> apr_status_t:
>
> apr_md5_init()
> apr_md5_update()
> apr_md5_final()
> apr_md5_encode()
> apr_md5() /* this one will get the obvious code tweak too */
>
> They currently can only return success anyway, and it's hard to
> conceive of an implementation that would do otherwise.
>
> If any APR developer knows a reason not to make this change, please
> speak now or forever hold your peace... :-) (I'll wait a day.)
>
> -Karl
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: useless return values for apr_md5_*() functions...
Posted by Bill Stoddard <bi...@wstoddard.com>.
-1 (not a veto)
With the release of a major application (Apache 2.0), the APR API should not change unless
there is a compelling reason. This is not a compelling reason.
Bill
> I'm planning to make the following functions return void instead of
> apr_status_t:
>
> apr_md5_init()
> apr_md5_update()
> apr_md5_final()
> apr_md5_encode()
> apr_md5() /* this one will get the obvious code tweak too */
>
> They currently can only return success anyway, and it's hard to
> conceive of an implementation that would do otherwise.
>
> If any APR developer knows a reason not to make this change, please
> speak now or forever hold your peace... :-) (I'll wait a day.)
>
> -Karl
>