Closed v1993 closed 5 years ago
Maybe error handling would be a good idea.
@TingPing Well, I've already added checks which were required to produce meaningful errors during testing. Do you suggest to add assert
on every single call which may fail in theory?
Well, at a glance the splice()
call is among the more important ones. For examples I'd also say assert()
s are bad compared to printing the error messages (for things expected to fail, like bad input).
@TingPing Ok about more checks, will do that. What do you have against assert
, by the way? They still print error message to console (and exit to prevent further problems).
@TingPing Are you fine with this now?
Guys, this is an example, not a production application. Excessive error checks may only obscure it IMHO
I mean I'm not going to block it or anything. I just think examples should represent real usage and that means handling expected errors not asserting.
No big deal.
I'll count that as "reviewed by @TingPing" :-)
I've been struggling for a while with how to use converters, so I think that this example may help others later.
If you have any questions/ideas about it, I will be glad to help with improving.