Re: Software bugs aren't inevitable



Terry Reedy wrote:

But that, I admit, would be an invalid conclusion. And that, I claim, is also invalid when 'iteration' and 'recursion' are reversed, no matter how often repeated in texts and articles. The difference is between the algorithms, not the differing syntactic expressions thereof.

There is a comparison in there about iteration vs. recursion, but it's probably not the one intended.


The algorithm one uses sometimes depends quite heavily on which mindset you're using. Some algorithms require much more mental effort to understand when in their recursive form versus the iterative form, and vice versa. If you're stuck thinking in only one form, you might miss the better algorithm because it is not as "simple" in that form.

The ideal case would be a programming language that allows you to write the algorithm in whatever form is simplest/most comfortable, and then automagically transforms it to the form that works the fastest under the hood.
.




Relevant Pages

  • Re: newbie question: recursion algorithm and iterative algorithm
    ... Prolog doesn't have iteration. ... recursion in Prolog, and the implementation may implement it by iteration. ... recursive algorithms can always ...
    (comp.lang.prolog)
  • Re: Grammatical Recursion
    ... >> One can only talk about the difference between recursion and ... >> iteration in the context of specific computation models. ... Shifting the topic from the algorithms themselves ...
    (sci.lang)
  • Re: Learning Lisp in Linux?
    ... iteration. ... There are other algorithms were are indeed naturally recursive. ... Lisp programmers generally write those algorithms in a recursive style. ... But CL programmers tend to write iterative algorithms in an iterative style. ...
    (comp.lang.lisp)
  • Re: Delegates, Generic Methods and algorithms - Functional versus Procedural
    ... I was reading another post and saw an argument that brought ... Collections Algorithms class. ... functional coding as a way of separating action, iteration and data. ... provide the delegate? ...
    (microsoft.public.dotnet.languages.csharp)
  • Delegates, Generic Methods and algorithms - Functional versus Procedural
    ... I was reading another post and saw an argument that brought ... Collections Algorithms class. ... functional coding as a way of separating action, iteration and data. ... provide the delegate? ...
    (microsoft.public.dotnet.languages.csharp)

Loading