Division of Labor

When you create common functions, it’s important to make sure any wrapped queries do one thing at a time.

Today I was working on a function I originally wrote that queried something based on a primary key and returned related data for 1…..n records.. It was then modified by someone else so that it had successive left joins. Consequently, other pages and functions assumed it was returning one row per entity found, while it was actually returning one row per another entity per entity.

I made the assumption that others would not make existing 1-dimensional queries multi-dimensional.

So basically, instead of getting the expected n items from this function, I got more like 8*n due to the 2 left joins. Equally exciting is the fact that the majority of that stuff was NULL.

When you are expecting a certain retval, don’t update a function to return something completely different or your coworker will spend 2 hours figuring out why your application isn’t working right.

The Soldiering Life

Ambling madly all over the town
The call to arms you likened to a whisper
I likened to a radio
You were a brick bat, a bowery tuff, so rough
They called you from a cartoon
Pulled out of your pantaloons

But You
My brother in arms
I’d rather I’d lose my limbs
Than let you come to harm

But You
My bombazine doll
The bullets may singe your skin
And the mortars may fall

But I
I never felt so much life
Than tonight
Huddled in the trenches
Gazing on the battle field
Our rifles blaze away
We blaze away

- The Decemberists, “The Soldiering Life”

Nothing Gold Can Stay

Nature’s first green is gold,
Her hardest hue to hold.
Her early leaf’s a flower;
But only so an hour.
Then leaf subsides to leaf.
So Eden sank to grief,
So dawn goes down to day.
Nothing gold can stay.

Robert Frost