I've got some neat code that I may node up after I get this small task done. Essentially what it does is print out a table (html) with alternating colors for the "rows" based upon the output of a sql statement.

Consider this:

select whosit, whatsit, wheresit, howsit from huh where howsit = 'with the lead pipe' and wheresit = 'in the +lavatory';
this doesnt actually require any labelling other than the columns (whosit, whatsit, wheresit). so the program, as written, just numbers the rows so that coworkers can communicate "on X.cgi at row #53, see how howsit is with the lead pipe but whosit is mr plum?" this is great, and I thought it was a totally orthogonal design.

Orthogonality matters to me because i've been reading The Pragmatic Programmer: From Journeyman to Master lately. It mattered to me before, because I liked to be able to pull a sub out of a script and plug it into another. The book however, stressed that I should be able to change my entire dataset without changing the function that represents my data.

Two months ago, this wouldn't have bothered me. But now, I see that I'm going to tack on another small sub (see "the big ball of mud" school of design), and reduce the orthogonality from where it is (which only works with a broad, but still defined, dataset).

So, back to the matter at hand. The reason this program is getting busted is I have to add a row descriptor where before only columns were necessary. I can pass in another parameter (in the guise of a column that will be the identifier for the rows), but it will be imperfect. I'd rather not do that, but I suspect thats what I'm going to do, to avoid modifying my semiorthogonal code.

What I'm looking for is two things, I guess, from the other programmers in search of perfection at the monastery.

I havent checked to see if the book has been reviewed yet, but I would recommend it to any intermediate to advanced programmer (the wisdom is lost on the inexperienced imo).

brother dep.

--
Laziness, Impatience, Hubris, and Generosity.


In reply to Sacrificing Orthogonality (code) by deprecated

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.