Worst ideas/features in programming languages?
Atila Neves
atila.neves at gmail.com
Tue Nov 9 11:37:49 UTC 2021
On Monday, 8 November 2021 at 14:23:15 UTC, Ola Fosheim Grøstad
wrote:
> On Monday, 8 November 2021 at 14:08:32 UTC, Atila Neves wrote:
>> I thought Rust error handling wasn't easy by default until
>> they added the ? operator, at which point it became like
>> exceptions but better.
>
> Looks like syntactical sugar to me, but I am no Rust expert.
Correct, but then again, anything other than machine code is
syntatical sugar. So is `throw new Exception("oh noes");`
> It means you now loose context
I don't see how.
> and how do you log?
The same way in pretty much any and all programs written that
handles exceptions - some outer loop, possibly in the main
function.
>> To me that was always the issue with error handling without
>> exceptions - how to easily just propagate it up (nearly always
>> what one wants to do). I think they nailed it.
>
> For simple situations maybe, but it looks like a hack, as far
> as I can tell from the docs.
I disagree. To me, it has all the convenience of exceptions with
none of the drawbacks.
More information about the Digitalmars-d
mailing list