Re: Callable assertion?
"Roy Smith" <roy@panix.co m> wrote in message
news:roy-408A7D.18354005 102003@reader2. panix.com...[color=blue]
> There's a big difference between verifying that a passed parameter[/color]
has[color=blue]
> the properties it's supposed to have and trying to figure out if you[/color]
can[color=blue]
> read a file or open a socket.[/color]
Readability and connectability are also possible properties of passed
parameters. For your purpose of init-time checking, the relevant
property of properties is whether the property can be satifactorily
checked at init time or not.
[color=blue]
> The former catches a programming error. If I meant to pass fred and[/color]
I[color=blue]
> pass fred() by mistake, the problem is going to be there every time[/color]
I[color=blue]
> run the program until I fix the code.[/color]
And if you pass the name of an access prohibited file, that error will
also continue until fixed.
Alex Martelli has written several pages on 'look before you leap' (his
phrase) versus 'try and respond to failure' (not his). Look them up
for more discussion of this topic.
Terry J. Reedy
"Roy Smith" <roy@panix.co m> wrote in message
news:roy-408A7D.18354005 102003@reader2. panix.com...[color=blue]
> There's a big difference between verifying that a passed parameter[/color]
has[color=blue]
> the properties it's supposed to have and trying to figure out if you[/color]
can[color=blue]
> read a file or open a socket.[/color]
Readability and connectability are also possible properties of passed
parameters. For your purpose of init-time checking, the relevant
property of properties is whether the property can be satifactorily
checked at init time or not.
[color=blue]
> The former catches a programming error. If I meant to pass fred and[/color]
I[color=blue]
> pass fred() by mistake, the problem is going to be there every time[/color]
I[color=blue]
> run the program until I fix the code.[/color]
And if you pass the name of an access prohibited file, that error will
also continue until fixed.
Alex Martelli has written several pages on 'look before you leap' (his
phrase) versus 'try and respond to failure' (not his). Look them up
for more discussion of this topic.
Terry J. Reedy
Comment