object.opEquals return type

Edward Diener eddielee_no_spam_here at tropicsoft.com
Sun Feb 24 08:53:48 PST 2008


Max Samukha wrote:
> Edward Diener wrote:
> 
>> Why is the return type of object.opEquals an 'int' rather than a 'bool' ?
> 
> Performance is supposed to be better with ints. It was discussed here:
> http://www.digitalmars.com/d/archives/digitalmars/D/bugs/7933.html#N7933
> 

Thanks for the link.

It is very poor logic to justify an incorrect design decision merely 
based on efficiency, and I am surprised that Walter did so. One might as 
well eliminate 'bool' entirely from the language based on the same 
supposition of inefficiency as compared to an 'int'.

If one were to carry the efficiency argument further, than the other 
possible logical conclusion is that a 'bool' should be an 'int' ( 
constrained to be of value either 0 or 1 ) rather than a 'byte'. But to 
justify a poor design decision based purely on efficiency is exceedingly 
silly.

Hopefully Walter will come to his senses and change the decsion to 
return 'int' from object.opEquals.



More information about the Digitalmars-d mailing list