Boost logo

Boost :

Subject: Re: [boost] [outcome] Requesting second pre-review of Boost.Outcome tutorial
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2017-01-26 10:43:28


2017-01-26 16:18 GMT+01:00 Olaf van der Spek <ml_at_[hidden]>:

> On Thu, Jan 26, 2017 at 4:03 PM, Andrzej Krzemienski <akrzemi1_at_[hidden]>
> wrote:
>
> > Wow. Indeed Rust docs do it. This is what you are referring to:
> > http://rustbyexample.com/std/result.html
> > This example doesn't do good service to Rust, does it?
> >
>
> The implementation might be bad but I don't think the interface is bad,
> assuming you want to handle the errors as runtime errors.
>

If you want to report overflow or precision errors, then this `MathResult`
makes sense.

But this example illustrates some bad practice of artificially widening the
contract only to report the breakage in the return value. It is as though
it were saying "here is how you can use Rust's Result to write poor code".
Ok, but does it help me write good code?

Regards,
&rzej;


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk