Performance of exception handling

Robert Jacques sandford at jhu.edu
Tue May 10 07:53:03 PDT 2011


On Tue, 10 May 2011 01:15:04 -0400, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 5/9/2011 9:48 PM, Andrej Mitrovic wrote:
>> Well I can understand throwing exceptions when using readln() or
>> validate(), but decode() is used for one code point at a time.
>> Throwing is overkill imo.
>
> Perhaps decode() is badly designed.

Well, you are supposed to use validate first on any untrusted input. Now  
the fact that validate returns void and throws an exception and there is  
no corresponding 'isValid' routine probably is bad design.


More information about the Digitalmars-d mailing list