Feedback from the Gripes and Wishes Campaign
Ernesto Castellotti
erny.castell at gmail.com
Tue May 30 19:45:27 UTC 2023
On Monday, 29 May 2023 at 21:18:23 UTC, Ernesto Castellotti wrote:
> On Monday, 29 May 2023 at 20:57:22 UTC, H. S. Teoh wrote:
>> On Mon, May 29, 2023 at 08:21:37PM +0000, Ernesto Castellotti
>> via Digitalmars-d wrote:
>>> On Monday, 29 May 2023 at 18:40:52 UTC, Paul Backus wrote:
>>> > revisiting the use of exceptions in the standard library
>>>
>>> As far as I'm concerned, they really shouldn't be used. I
>>> think exceptions are one of the worst features of C++, Java
>>> and D etc
>>
>> Care to elaborate why?
>>
>>
>> T
>
> Mainly because exceptions are often used for errors that aren't
> really exceptional", I often found myself having to handle
> exceptions (mostly in Java and C++) that really didn't give a
> damn and just abort the program.
>
> I have rarely seen exceptions handled well by programmers other
> than in C++ code done by really experienced programmers, I much
> prefer error handling like Rust and Go ie with multi-value
> returns, in my experience I have always found this technique
> leads to much better error handling than using exceptions.
> (https://go.dev/doc/faq#exceptions,
> https://go.dev/blog/error-handling-and-go,
> https://doc.rust-lang.org/book/ch09-00-error-handling.html)
Still about the exceptions, what is the reason that motivates the
existence of this https://dlang.org/library/object/error.html
If they are unrecoverable errors how could I handle them as
exceptions? Print an error message and close the program? But
then why am I using exceptions anyway to do this?
More information about the Digitalmars-d
mailing list