background

sample scenario one

My current boss said the following:
5. We should revisit all error messages currently being generated to determine if they adequately describe errors that occur and are sufficient for Sean and Scott to perform remediation.

This implies that all error messages are searchable and typed. In the best case, I would be able to list all error messages and list each messages attributes, ie, loglevel, which module has the message, etc.

sample scenario two

Now, in my job before this, someone else (thank god it was not me), had to answer this following question:
How many different queries are we using in our system (which was a huge system with easily 1000 different queries)? Also, what tables are these queries accessing? How many of our queries are SELECT statements? How many are UPDATE statements?

Again, the questions imply that all SQL queries in the Perl application are searchable.

While I never ever had to solve this problem myself, being a forward-thinking kinda guy, I went ahead and wrote SQL::Catalog in anticipation of one day wanting a means of cataloging SQL queries.

questions

  1. When someone writes code, even though searchable "metataggable" attributes of the code might be there, they probably dont stop to think about such things nor make the code searchable as such. How much of a program should consist of Structured, Typed, Searchable Catalogs (e.g. SQL::Catalog has done this to an extent for SQL), what other domains should we do this for? In fact, perhaps it should be a shame to write comments in code. Perhaps we should create database-ready attributed descriptions of each line so that such program characterization is possible.
  2. Have you ever made a program catalog? Would you use Class::Phrasebook to build your catalog? Or would you create a set of database tables?

conclusion

Perhaps I am appearing to be overly anal. Overly paranoid. Overly structural. Overly typed. But it took me 30 minutes and grep to do what might have taken a query of some sort had my code been structured and typed and described to begin with.

Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality


In reply to [meditation] Structured, Typed Program Catalogs by princepawn

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.