Path: ...!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Chris M. Thomasson" Newsgroups: comp.lang.c Subject: Re: filling area by color atack safety Date: Sun, 17 Mar 2024 13:19:29 -0700 Organization: A noiseless patient Spider Lines: 42 Message-ID: References: <87wmq2jn7s.fsf@bsb.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 17 Mar 2024 20:19:30 -0000 (UTC) Injection-Info: dont-email.me; posting-host="fa1fc55c573ae485c64f06b83fc54ff2"; logging-data="3896544"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184A6jGx53WvYRf7MdcfvzhDm00CbUAP4k=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Lm/FMprgSmlBUfnx00Iecudy+bs= Content-Language: en-US In-Reply-To: Bytes: 2668 On 3/16/2024 1:29 PM, Chris M. Thomasson wrote: > On 3/16/2024 1:02 PM, Malcolm McLean wrote: >> On 16/03/2024 18:21, Scott Lurndal wrote: >>> Malcolm McLean writes: >>>> On 16/03/2024 13:55, Ben Bacarisse wrote: >>>>> Malcolm McLean writes: >>>>> >>>>>> Recursion make programs harder to reason about and prove correct. >>>>> >>>>> Are you prepared to offer any evidence to support this astonishing >>>>> statement or can we just assume it's another Malcolmism? >>>>> >>>> >>>> Example given. A recursive algorithm which is hard to reason about and >>> >>> Perhaps hard for _you_ to reason about.  That doesn't >>> generalize to every other programmer that might read that >>> code. >>> >>> >>  From experience this one blows the stack, but not always. Sometimes >> it's OK to use. > > Blowing the stack is not good at all. However, sometimes, I consider a > recursive algorithm easier to understand. So, I build it first... Get it > working, _then_ think about an iterative solution... Gaining the iterative solution from a working recursive solution is the fun part! :^) > > >> >> Since you can reason about it so easily, you can tell the others when >> you're OK and when you are not, in a handy intuitive way so that >> someone thinking of implementing it will know. >> >