[OT] Sorry and Goodbye...

claptrap clap at trap.com
Wed Jun 2 09:25:43 UTC 2021


On Tuesday, 1 June 2021 at 10:23:08 UTC, Andrei Alexandrescu 
wrote:
> On 5/31/21 5:47 AM, claptrap wrote:
>> On Sunday, 30 May 2021 at 22:29:15 UTC, Walter Bright wrote:
>>> On 5/29/2021 3:19 PM, Avrina wrote:
>>>> What is the meaning of trust but verify?
>>>> In the study of programming languages, the phrase has been 
>>>> used to describe the implementation of downcasting: the 
>>>> compiler trusts that the downcast term will be of the 
>>>> desired type, but this assumption is verified at runtime in 
>>>> order to avoid undefined behavior.
>>>
>>>
>>> It means you trust people to do the right thing, but still 
>>> verify that it gets done right.
>> 
>> Its an awful proverb, it's like 1984 double speak.
>
> Oh no it isn't.

Oh yes it is!

>> I mean if I hire a PI to check up on my wife, I cant very well 
>> claim that I trust her.
>
> That would not quite mean trust because a spouse cannot cheat 
> by means of an honest mistake. Better examples are counting the 
> cash in a transaction. That doesn't mean there's no trust 
> involved, it just means there's verification against a possible 
> honest mistake.

A runtime check on a downcast is a check against incompetent 
programmers not nefarious ones. So the trust in that context is 
"trust that the programmer knows what hes doing", not "trust that 
he's honest".

But if the compiler then checks it at runtime then it doesn't 
really trust you at all.

So it should be "humans make mistakes, don't trust 'em"

but that's not as catchy :)


More information about the Digitalmars-d mailing list