Saturday, June 18, 2011

Code is Poetry

Tweeted by Chris Knight via Ask Leo on FB:
Programmers who apply for a coding job: Your spelling & sentence structure on your resume... is also a CODE. :-)
This started a long rambling train of thought for me during yesterday's morning commute. I have kept the "Code is Poetry" wordpress tag at the bottom of the site because it has always appealed to me. Code is poetry is poetic is code is words is structure . . .

As I have matured (which sounds so much better than "aged") I have grown to appreciate poetry much more than I did in long-ago English classes. And the books and authors I appreciate are generally those with interesting and unique sentence structure and word play. I immerse myself and wallow in the words with a happy smile on my face, as the dogs do when they find something delicious in the pasture.

Some favorites that come to mind: All the Pretty Horses for the long rambling train-of-thought sentences. Everything is Illuminated for the English-as-second language word play. Lolita for the alliteration (how can someone named Carolyn Cannon who has Cardigan Corgis not love alliteration?)

When I write myself I try to take time and choose words and structure carefully and with precision.

And then there's what I get paid to do in real life:


V3$ = Z$ \ HOLD$ = MID$(V3$,A3%(10,1)+1,A3%(11,1)-A3%(10,1))


W2 = VAL(MID$(V3$,A3%(8,1)+1,A3%(9,1)-A3%(8,1)))

IF W2=0 OR HOLD$<>SPACE$(LEN(HOLD$)) THEN GOTO NEXT.SITE

IF MID$(V3$,A3%(3,1)+1,A3%(4,1)-A3%(3,1))<>AGDAY$ THEN GOTO NEXT.SITE

TP$ = MID$(V3$,A3%(9,1)+1,A3%(10,1)-A3%(9,1))

IF INV%>0
FOR I% = 1 TO INV%
IF LEFT$(INVNO$(I%),1)=TP$
INV$ = INVNO$(I%) \ GOTO FOUND.INV
IFEND
NEXT I%
IFEND

OK% = -1

WHILE OK%<0
INV$ = RPAD$(TP$&STR$(NXT),B4(4))
Z0% = 9 \ Z1 = 0 \ Z2% = 0 \ Z1$ = INV$ \ GOSUB BASE
IF Z9%>0
NXT = NXT+1 \ IF NXT>999999.0 THEN NXT = 1
ELSE \ OK% = 1
IFEND \ WEND
FOUND.INV:Z0% = 4 \ Z1 = 0 \ Z2% = 0 \ Z1$ = INV$ \ GOSUB BASE

OF% = Z9% \ IF OF%=0
INV% = INV%+1 \ INVNO$(INV%) = INV$
V4$ = SPACE$(B4(5))
V4$ = OVR$(V4$,1,A4%(2,1),V$&"00")
V4$ = OVR$(V4$,A4%(2,1)+1,A4%(3,1)-A4%(2,1),AGDAY$)

Now: isn't that a pretty snippet? That's from building the repetitive monitoring invoices at the day job.