I think this totally depends on your target audience.

For the most part, I work with the Black Box Theory(tm). I explain the interface and little else. My reasoning is multitiered.

One, I rarely want the programmers working under me to go 'spelunking' in my code. Not because I don't have faith in my code or my coworkers, but being the one whose name is stamped all over it, I'd prefer if 'streamlining' my code was team effort with me on the team.

I document my code religiously (more for my own benefit really - I'm forgetful in my advanced years) so it _should_ be easy enough to change it. *sigh* Getting of topic...

Two, when you work in a project environment with more than one coder, you agree to certain functionality and code to it. I usually add a little more than is asked for, but too much. A little above expectations and you're a hero, too much, and you have too much free time. It's a fine line.

I try to code modules (objects, whatever) for maximum reusability, which usually means KISS.

Just my US$0.02


In reply to Re: How to write library code by cacharbe
in thread How to write library code by jorg

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.