Groups | Search | Server Info | Login | Register
Groups > comp.lang.ada > #49801
| Newsgroups | comp.lang.ada |
|---|---|
| Date | 2021-10-16 06:26 -0700 |
| References | <c2f132ab-dca4-4400-a913-12616c0d8489n@googlegroups.com> <skcesm$sgf$1@dont-email.me> <skcfp6$j19$1@gioia.aioe.org> <skcmp7$mqd$1@dont-email.me> <ske078$122h$1@gioia.aioe.org> |
| Message-ID | <60346167-ea7c-40ee-bdf5-cc67b75fa964n@googlegroups.com> (permalink) |
| Subject | Re: Code flow control |
| From | Kevin Chadwick <m8il1ists@gmail.com> |
On Saturday, October 16, 2021 at 8:50:04 AM UTC+1, Dmitry A. Kazakov wrote: > On 2021-10-15 22:02, G.B. wrote: > > On 15.10.21 20:03, Dmitry A. Kazakov wrote: > >> On 2021-10-15 19:48, J-P. Rosen wrote: > >> > >>> Some people reserve exceptions for signalling errors. I regard them > >>> as a way to handle "exceptional" situations, i.e. when the normal > >>> flow of control cannot continue. For example, in a deep recursive > >>> search, they are handy to stop the recursion and go back to top level > >>> when you have found what you were looking for. Some would disagree > >>> with that. > >> > >> I strongly believe that this is the only consistent way to treat > >> exceptions. > > > > Once found, pass the result to the party that needs it. > > Then, finish the computational task that found the result. > > Is there anything besides exceptions to do that, and orderly? > Exceptions is having two results: data read or file end, commit or > rollback, item parsed or syntax error, next item or completed etc. > Consequently there are two paths of execution, one per result. The more > frequent/regular/complex path runs as the normal flow another does as > exception propagation. > > In a data flow architecture you can have as many paths as you wanted, > e.g. in a state machine. That does not work well as programming > paradigm. Two paths is just how much the programmer can handle. > -- > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de My experience with exceptions and try catch even, is limited. I am a little confused as to the optimum extent of their use between this thread and the thread "best practice: error handling" "https://groups.google.com/g/comp.lang.ada/c/xL0qGSUQSbE/m/N8LJ8VNMJEQJ" I will look at some code on github to further my understanding. If anyone has any links to good examples, then that would be useful? Regards, kc
Back to comp.lang.ada | Previous | Next — Previous in thread | Next in thread | Find similar
Code flow control Kevin Chadwick <kevc3no4@gmail.com> - 2021-10-15 08:08 -0700
Re: Code flow control "J-P. Rosen" <rosen@adalog.fr> - 2021-10-15 19:48 +0200
Re: Code flow control "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-10-15 20:03 +0200
Re: Code flow control Kevin Chadwick <kevc3no4@gmail.com> - 2021-10-15 12:19 -0700
Re: Code flow control "G.B." <bauhaus@notmyhomepage.invalid> - 2021-10-15 22:02 +0200
Re: Code flow control Kevin Chadwick <kevc3no4@gmail.com> - 2021-10-15 14:30 -0700
Re: Code flow control "Randy Brukardt" <randy@rrsoftware.com> - 2021-10-15 17:51 -0500
Re: Code flow control "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2021-10-16 09:50 +0200
Re: Code flow control Kevin Chadwick <m8il1ists@gmail.com> - 2021-10-16 06:26 -0700
Re: Code flow control Kevin Chadwick <kevc3no4@gmail.com> - 2021-11-26 05:44 -0800
Re: Code flow control "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> - 2021-10-15 19:53 +0200
Re: Code flow control Roger Mc <rogermcm2@gmail.com> - 2021-10-15 16:30 -0700
csiph-web