comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Code flow control
Date: Sat, 16 Oct 2021 09:50:00 +0200	[thread overview]
Message-ID: <ske078$122h$1@gioia.aioe.org> (raw)
In-Reply-To: skcmp7$mqd$1@dont-email.me

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

  parent reply	other threads:[~2021-10-16  7:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15 15:08 Code flow control Kevin Chadwick
2021-10-15 17:48 ` J-P. Rosen
2021-10-15 18:03   ` Dmitry A. Kazakov
2021-10-15 19:19     ` Kevin Chadwick
2021-10-15 20:02     ` G.B.
2021-10-15 21:30       ` Kevin Chadwick
2021-10-15 22:51         ` Randy Brukardt
2021-10-16  7:50       ` Dmitry A. Kazakov [this message]
2021-10-16 13:26         ` Kevin Chadwick
2021-11-26 13:44           ` Kevin Chadwick
2021-10-15 17:53 ` Jeffrey R. Carter
2021-10-15 23:30 ` Roger Mc
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox