Posts Tagged code quality

Runtime (Jonathan Coulton ‘Sunshine’ parody lyrics)


The other day I was reading some developer documentation about nodes while I had Jonathan Coulton’s ‘Sunshine’ from the album ‘Solid State’ in my head. ‘The road we’re on’ became ‘the node we’re on’ and the next thing I know I’m writing a parody about the runtime, and errors that could have been detected by the compiler in other languages or with stricter compiler settings but instead aren’t detected until runtime. I didn’t end up using the ‘node’ line. The first verse barely needed changing, so for fun I tried to keep as many words from the original as I could in the rest of the parody as well. Whether that’s a good thing depends on your taste and how well you know the original. Feel free to sing it if that’s a thing you can do!

We were blind to every sign
That we should have seen
In a clearly broken line
Machine to machine
Our mistakes were the future
But no one could tell

Lots of errors to detect
The tests didn’t show
The things compilers could have checked
We just let it go
Walked away as assumptions
Crumbled and fell

We bust our arse
To find the errors the machine could parse
Catch it just-in-time
Here in the runtime

Cast the pointer to a type it’s not (runtime)
Walk the edge case of the code we’ve got (runtime)

Every bit was filed away
There’s memory to fill
There’s no message that could say
Receiver is nil
We don’t heed any warnings
Try it and bail

Cast from Any type to this
The object’s a tease
Reflect to find out what it is
A sudden unease
If the data’s corrupt
Then when did it fail?

We soldier on (just a flesh wound)
Heap space and registers are almost gone (memory use ballooned)
Watch the stack unwind (maybe we’re doomed)
Here in the runtime

Cast the pointer to a type it’s not (runtime)
Walk the edge case of the code we’ve got (runtime)

The caller of the method must not do this
Everything’s your fault, you have been remiss
Code is fine, the world has something amiss

All the tests have slipped away
Just garbage I/O
I won’t last another day
And neither will O
EOF of a stateless mutable thing

The data’s blitzed (blame the new hire)
There’s nothing left that can remember it (cut the red wire)
But this is fine (halt and catch fire)
Here in the runtime

Cast the pointer to a type it’s not (runtime)
Walk the edge case of the code we’ve got (runtime)

Cast the pointer to a type it’s not (runtime)
Walk the edge case of the code we’ve got (runtime)

I’m not so sure about ‘EOF of a stateless mutable thing’ and whether it would be better stateful or immutable. It doesn’t exactly make sense (does anything, when it’s that far gone?) but it sounds cool, and a lot like the original. I’ll release it like this and patch it in production if necessary. 😉

, , , , , , , ,

5 Comments

Seven of Clubs: The Bad Coder’s Favourite Things


Seven of clubs featuring Admiral Ackbar

To be sung to the tune of My Favourite Things from The Sound of Music (though like in my other My Favourite Things parody, the structure is modeled more on various other parodies of that song.) Feel free to record yourself singing it so I don’t have to:

Catch all exceptions; what are they the heck for?
Just return nulls that the callers won’t check for,
or show an error box, if they insist,
brought back by loops every time it’s dismissed.

Checks and injection and joins are just theories;
just add more levels of nested subqueries,
lace all your filters with unescaped strings,
fetch from a multi-use table called THINGS.

Love the warning
marks adorning
all your huge source files;
they’re all just suggestions, there’s no need to test
as long as it all compiles.

Code reuse means not one code block is wasted —
ev’ry last one has been copied and pasted.
Make up for duplicates no more the same:
reclaim some space with a one-letter name.

I’ve used these same antipatterns since FORTRAN;
why should I listen to hacks I’m paid more than?
Even my students are older than you;
how dare you tell me I need code review?

Slam resource leaks
till you’re hoarse, geeks!
Rail against that kludge.
There’s no way to beat them; you’ll have to submit
to The Daily What The Fudge.

Read the rest of this entry »

, , , , , , ,

2 Comments

%d bloggers like this: