Liste des Groupes | Revenir à cl c |
On 3/16/2024 1:02 PM, Malcolm McLean wrote:Gaining the iterative solution from a working recursive solution is the fun part!On 16/03/2024 18:21, Scott Lurndal wrote: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...Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:From experience this one blows the stack, but not always. Sometimes it's OK to use.On 16/03/2024 13:55, Ben Bacarisse wrote:>Malcolm McLean <malcolm.arthur.mclean@gmail.com> 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.
>
>
>
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.
>
Les messages affichés proviennent d'usenet.