Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
The stupid question is the question not asked
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Back when I was studying stuctured program design (and promptly forgot most of it and had to relearn it), I remember my instructor explaing that all programs had four steps:

  1. Initialization
  2. Input
  3. Calculation
  4. Output

Admittedly, that's a bit simplistic and I suspect that he was only familiar with procedural programming (as opposed to functional, OO, and logical). While I don't necessarily design my programs into four sections, they often break down that way.

What I usually do is start with the output. What do I want my end result to be? From that, I can determine what data I need to capture. Then, I go to the input section and figure out my data sources. With this, I have my beginning and end data and I find it relatively easy to work out the data flow (well, usually).

The data flow, to me, is the 'calculation' part. Frankly, I don't even worry about my data structures until I have some idea of what those calculations are. With that, I can often identify common elements to factor out. Once I know those, I design data structures to fit them.

I can't say that I follow this process religiously (ooh, I'm a bad monk), but what I prefer to do is something similar to this node. Also, Warnier-Orr design is something that I've enjoyed, though it often breaks down with object-oriented programming.

Cheers,
Ovid

Vote for paco!

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to (Ovid) Re: Coming up with code design by Ovid
in thread Coming up with code design by zdog

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others lurking in the Monastery: (9)
    As of 2014-04-18 09:48 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (465 votes), past polls