Google's Go & Exceptions

bearophile bearophileHUGS at lycos.com
Tue Jan 26 11:35:40 PST 2010


Walter Bright:
> That may wind up suffering similar problems as checked exceptions do - 
> just do a quick and dirty assign the return value to a hastily declared 
> temp and ignore it, meaning to fix it later.

Oh, I agree that exceptions are generally better (but that warn_unused_result of GCC can be used in C too where you don't have D-like exceptions).
Regarding exceptions, I don't think you can find many of them in game engines written in C++, where performance matters.


> Of course, it doesn't actually get fixed later. Even worse, during code 
> reviews, it will look like the code is paying attention to the error 
> code, but it won't be.

Something similar can happen with exceptions, you can wrap something in a try-catch to silence the possible exceptions.

Bye,
bearophile



More information about the Digitalmars-d mailing list