For any given line or expression in the code, you should know exactly what it does and why it's in there. (I was once going over some code with the student worker who wrote it, and I asked him: "What does this line do?" When he couldn't answer that question, I must confess that I enjoyed giving him a really hard time about it.)

For any given function/subroutine that you either define or invoke in your code, you should know where its usage is documented (parameters, return values, behaviors for error conditions). For functions you have written, this entails that you write documentation for them, or at least know how to extract this information easily from your code. Memorizing all the details about all functions is not required, and is not practical (probably not humanly possible) -- that's why having documentation (and knowing how to get at it) is so important.

As it is with functions/subroutines, so it is also with the inputs and outputs of a given program. This can be a bit daunting when the program is a GUI with lots of flexibility in what the user can do, but even there, it should be possible to describe what the user is expected to provide as input, and achieve as a goal. Such documentation is a courtesy that the programmer owes to the user.


In reply to Re: What you should know about your program? by graff
in thread What you should know about your program? by Anonymous Monk

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.