[OT] - C++ exceptions are becoming more and more problematic
forkit
forkit at gmail.com
Fri Mar 4 21:02:16 UTC 2022
On Thursday, 24 February 2022 at 03:42:42 UTC, SealabJaster wrote:
> ...
> On a similar vein, if we have that sort of `catch expression`
> shown above, we could possibly make our own version of `if err
> != nil` spam look even worse :D!
>
> ...
>
> if(toInt("123") catch(ex) + toInt("abc") catch(ex) &&
> ex.isError)
> {
> writeln(ex.msg);
> return -1;
> }
> ```
>
> But the point is, if we want to avoid Go's if-else spam, we
> need some other weird syntax to sugar on top of things.
Hey...let's just go crazy, and borrow some bew syntax from the
.net team (bang..bang !!)
// don't ask me what this would do... I don't care.
if( toInt("123")!! + toInt("abc")!!)
{
writeln(ex.msg);
return -1;
}
Seriously, when will this obsesssion with constantly changing
languages..stop!
D... plz learn the lessons from the silly .net team... I no
longer even recognise C#
https://devblogs.microsoft.com/dotnet/early-peek-at-csharp-11-features/
More information about the Digitalmars-d
mailing list