Fellow monks,

As I'm wading through "Mastering algorithms with Perl" and interesting idea was born in my mind. It's been long since I first noticed it - implementation of algorithms is inherently procedural.

Think of a known algorithms book like Cormen et. al. ("Introduction to algorithms"). The pseudo code in it is procedural. Now, it's understandable that all the books with C implementations are procedural.

When we get to Perl we might expect to see other styles - but... we also see procedural (structural, or however you want to call it) code. No OO (OO has little meaning in algorithms, only in interfaces of data structures), no functional.

Even Lisp code of algorithms is usually procedural. See the common implementations of A*, for example.

So, I wonder... algorithm is "description of an operation step-by-step to solve some problem". Does this definition render it naturally to structural code ?


In reply to coding of algorithms is inherently procedural by spurperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.