DIP65: Fixing Exception Handling Syntax

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 10 03:17:46 PDT 2014


On Thursday, 10 July 2014 at 07:50:47 UTC, bearophile wrote:
> Walter Bright:
>
>> I suggest recognizing in the parser:
>>
>>   ( Identifier )
>>
>> as a special case, in addition to using 
>> Parser::isDeclaration(). Gradually we can turn that special 
>> case into a warning, then deprecation.
>
> It's better to do the opposite, accept the common safe syntax 
> "catch(Exception)" (it's common because often you don't need to 
> give it a name, it's like function arguments without a variable 
> name), and refuse the "catch all" that is dangerous, that is a 
> bad practice even in Python.
>
> Bye,
> bearophile

Agreed.


More information about the Digitalmars-d mailing list