Rant after trying Rust a bit

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 26 15:58:08 PDT 2015


On Sunday, 26 July 2015 at 18:13:30 UTC, Tobias Müller wrote:
> Alix Pexton <alix.DOT.pexton at gmail.DOT.com> wrote:
>> On 25/07/2015 9:48 PM, Walter Bright wrote:
>> 
>>> Unfortunately, Bruce Eckel's seminal article on it
>>> http://www.mindview.net/Etc/Discussions/CheckedExceptions has
>>> disappeared. Eckel is not a Java code monkey, he wrote the 
>>> book Thinking
>>> In Java
>>> http://www.amazon.com/gp/product/0131002872/
>>> 
>> 
>> 
>> https://web.archive.org/web/20150515072240/http://www.mindview.net/Etc/Discussions/CheckedExceptions
>
> This is article not convincing at all. His argument is 
> basically "Most programmers are sloppy and tend to catch and 
> ignore checked exceptions."
>

No it is that checked Exception encourage this behavior.

Ultimately, checked exception are a failure as they completely 
break encapsulation. Let's say you have a logger interface. Some 
of its implementation will just send the log to Dave Null, some 
write it in a file, some will send it over the network to some 
tailor, and so on. The class of error that arise from each is 
completely different and cannot be listed exhaustively at the 
interface level in any meaningful way.

> The same programmers that do this will just catch all 
> RuntimeExceptions at
> top level, write a log entry and proceed.
> That's actually not much better and certainly not correct error 
> handling.
>
> Tobi

This is often the only meaningful thing you have to do with an 
exception anyway.



More information about the Digitalmars-d mailing list