Re: copying arrays





Pascal Bourguignon wrote:
Ken Tilton <ken@xxxxxxxxxxxxxxxxxx> writes:

[...]
The problem with PP is that, if our assumption is that people cannot
program, then we cannot program. It is one of those complexity
deals. That's wrong, let me try again: we cannot /in our programming/
make allowances for programmer fallibility. It's a slippery
slope. Once we make that bet, er, hedge, where do we stop? If we want
to say this bit of code might be flawed or this programmer might be a
loose cannon, where does the descent into paranoia halt?


In a way, and language specified error signaling is defensive programming.

Why should (/ 1 0) signal an error? It's obvious to everybody that you
should never try to divide 1 by 0. So there's no need to consider
this case in the code of /.

That is not paranoia, that is completeness. One has to consider (handle) zero as a denominator once one decides to have the / operator at all, and since by the definition of that operator no value can be returned as a result of division by zero, the API needs to include "...and watch out for this error...".



My point would be that DP or PP might be good ideas in some
circumstances and in some places, like ...

Like I said, it is a gray area. I comes down to cases. Come to think of it, this is one of those useless rules, because the hard part is knowing where in the gray some case falls.

kt

--
http://www.theoryyalgebra.com/

"Algebra is the metaphysics of arithmetic." - John Ray

"As long as algebra is taught in school,
there will be prayer in school." - Cokie Roberts

"Stand firm in your refusal to remain conscious during algebra."
- Fran Lebowitz

"I'm an algebra liar. I figure two good lies make a positive."
- Tim Allen

.