Rant after trying Rust a bit

Bruno Medeiros via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 15 03:16:15 PDT 2015


On 26/07/2015 23:58, deadalnix wrote:
> 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.
>

Then define the logger interface as throwing a generic Exception class. 
(a class that sits at the top of the hierarchy of the other Exceptions)



-- 
Bruno Medeiros
https://twitter.com/brunodomedeiros


More information about the Digitalmars-d mailing list