Channels ▼

Jack Woehr

Dr. Dobb's Bloggers

In Love with Form

September 04, 2008

Here in Colorado, the skies are grey and overcast. At this altitude, not much over.

There is moisture in the air. We notice that here because it's usually dry enough that you reset your embedded controller protoboard by walking into the same room whilst shuffling your feet.

A week ago, I knew it was the Last Beautiful Day of Summer. When I told the Wife, she scoffed, but here it is a week later and it has grown steadily cooler and grayer earlier and earlier in the day as the week slipped by and no hot day plus cooling jump in the Creek for me.

Damn. I sat through LDBoS in the basement coding PigIron. I wandered outdoors at noon to check the mailbox and squinted at the Yellow Goddess in the Sky, but that was it. I knew what I was doing.

Don't tell me I don't sacrifice for my Art.

Chess Grandmaster Bent Larsen said of the 1978 Baguio City World Championship that "Rain is much better for chess than hot, sunny days." It's better for computer programming, too. I only mention because, what, 125% of computer programmers are chess players?

That's no surprise because chess, music, and polyglotry all are language, in the case of chess or music, symbolic languages with little intrinsic meaning.

Ditto programming: very powerful manipulation of symbolic language with no intrinsic meaning. After all

chmod chown chgroup egrep

may be poetry or may be an invocation to some demiurge best forgotten.

We programmers should be wary of our excusable Love of Form. Some of the best of us filigree and fancify all that we touch. Form only has yea so much meaning in Programming:

  • compactness of representation
  • easy understanding for third-party evaluation and maintenance

PigIron gobbled error codes yesterday, mostly with some Perl before the Swine:

{geshibot}public class ReturnCode
// ...
rc = new ReturnCode("RCERR_IMAGECONND", 412);
        rc.addReasonCode(new ReasonCode("Image connectivity definition error", "RS_NONE", 0));
        rc.addReasonCode(new ReasonCode("Partner image not found", "RS_NO_PARTNER", 4));
        rc.addReasonCode(new ReasonCode("Parameters do not match existing directory statement", "RS_NO_MATCH", 16));
        rc.addReasonCode(new ReasonCode("Image device not correct type for requested connection", "RS_DEV_INCOMPATIBLE", 28));
        rcMap.put(412, rc);
// ...
     public static ReturnCode returnCode(int rc) {
        ReturnCode result = null;
        if (vsmapiRC == null) {
            vsmapiRC = new VsmapiRC();
        }
        result = vsmapiRC.getReturnCode(rc);
        return result;
    }
// ...
       public ReasonCode getReasonCode(int reason) {
            ReasonCode result = null;
            if (reasonCodes.containsKey(reason)) {
                result = reasonCodes.get(reason);
            } else {
                result = new ReasonCode("RS_UNKNOWN_TO_PIGIRON", "PigIron does not know this reason code", reason);
            }
            return result;
        }
// ...{/geshibot}

I wrote it in a couple of hours, it works, it's reasonably complete. Maybe someday I'll tidy it up. But I can think of lots of things more important, like blowing bubbles under a waterfall on the Last Day of Summer.

 

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video