Fwd: [review] Review of Outcome v2 (Fri-19-Jan to Sun-28-Jan, 2018)
Accidentally sent privately, forwarded below:
---------- Forwarded message ----------
From: degski
2018-01-28 12:12 GMT-03:00 degski via Boost
: 1. Use of outcome is more manual and cumbersome, i.e. more error-prone.
What is complex about the following?
<snipped the code> I'd just use boost::cnv::spirit and specify explicitly what happens when conversion didn't work... much shorter, very well optimized (the best) when it does work (the conversion)...
Server side code...
There's more than servers in life. Handling f.e. O-O-M-situations is not gonna help me on my lap-top... a re-think and re-write of my app is in this case in order, though... or a trip to the shop and buy a bigger stick (both the "slow path").
If the error is exceptional or not, it depends on context, not on the algorithm (e.g. connection failure on game client code and game server code and both of them being backed up by the same functions). Boost.Outcome let's you do just that by converting an error into an exception.
Yeah, that's another discussion, isn't it? errors vs. exceptions. Should exceptions be exceptional, or getting back to your conversion example, should we use exceptions to indicate failure as this is the case in Boost::Lexical_cast? I know the answer I like best, and moved on to Boost.Spirit. degski
2018-01-28 18:53 GMT-03:00 degski via Boost
I'd just use boost::cnv::spirit and specify explicitly what happens when conversion didn't work... much shorter, very well optimized (the best) when it does work (the conversion)...
I don't know boost::cnv::spirit. Can you briefly describe it? Do you register the callbacks/actions and let it take care of separating success case and failures case? -- Vinícius dos Santos Oliveira https://vinipsmaker.github.io/
On 28 January 2018 at 16:01, Vinícius dos Santos Oliveira < vini.ipsmaker@gmail.com> wrote:
I don't know boost::cnv::spirit. Can you briefly describe it? Do you register the callbacks/actions and let it take care of separating success case and failures case?
Boost.Spirit does a lot (most of it over my pay-grade), but you'll get the gist of the bit I was referring to here http://www.boost.org/doc/libs/1_66_0/libs/convert/doc/html/boost_convert/get... ... degski
2018-01-28 19:09 GMT-03:00 degski
On 28 January 2018 at 16:01, Vinícius dos Santos Oliveira < vini.ipsmaker@gmail.com> wrote:
I don't know boost::cnv::spirit. Can you briefly describe it? Do you register the callbacks/actions and let it take care of separating success case and failures case?
Boost.Spirit does a lot (most of it over my pay-grade), but you'll get the gist of the bit I was referring to here http://www.boost.org/doc/libs/1_66_0/libs/convert/doc/html/boost_convert/get... ...
Okay, it is very beautiful. It has plenty of options. You can set precision on floating point conversion and so on, plenty and plenty of options... and how does this add to the topic? The most I can see about error handling is a throwing value function and a `value_or` function. Do you want a `value_or` function? Is this what you're trying to tell us? If I understood correctly, previous Outcome version had monadic operations (which is much more complex than a value_or function) and I'm pretty confident it provided something like that (maybe under the name unwrap_or). Boost.Outcome will provide that for free to any facility you're going to implement. Be it lexical conversion of what not. Can you elaborate on your point? If I'm left alone I'll miss your point. It's becoming confusing the more you go. -- Vinícius dos Santos Oliveira https://vinipsmaker.github.io/
participants (2)
-
degski
-
Vinícius dos Santos Oliveira