Tiredness breeds inefficiency

I am working very tired tonight, luckily I caught it but look what nearly slipped through the net:

If rs <> nil then
  Return rs
else
  Return nil
end if

What crappy code have you come up with when too tired?

[quote=144276:@Mike Charlesworth]
What crappy code have you come up with when too tired?[/quote]

Pretty much all of it.

My entire app is full of crap!

While less than pretty, at least that code will return correct results. I have many examples of crappy code which returns “god knows what”. :slight_smile:

It’s when you look at the code next week, face palm yourself, and ask “what the F was I thinking there?”

There are many nights when I wake up after a couple of hours and realize my idiocy. If you’ve ever read Richard Bach’s book, “Out of My Mind: The Discovery of Saunders-Vixen”, you’ll know how that happens. Be patient, they’re busy with me now.

Tim,
Just looked for that book and it seems to be about an aircraft designer?
I was expecting it to be a psychology book when you said it “explains how that happens” :slight_smile:

Am I missing something?

The author gets “stuck” on things and when he sleeps, he visits “Saunders-Vixen”, a Steampunk-esque design and development firm that deals with odd problems and provides elegant solutions.

That’s what I was talking about - I run into an issue, doze off, and wake up with the solution in a couple of hours. Thus, I must have visited Saunders-Vixen :).

BTW - it’s a very quick read.

That’s the first rule of programming: don’t do any code if the brain is mushy.

Code that gets written while brain is in a mushy state…stays classified :wink:
(and reverted the next morning thanks to version control)
Note to self: Add “Mushy” as the commit note :wink:

Is there any other state? :wink:

Iowa :wink:

See what I did there? A “funny” reference to an album that turns the brain into something else :slight_smile:

I’m a pro – I don’t need to be tired to produce crappy code :slight_smile:

[quote=144363:@Albin Kiland]Iowa :wink:
See what I did there? A “funny” reference to an album that turns the brain into something else :)[/quote]

I would have said “Fargo” but thats only a city :slight_smile:

I think “You’re living in your own Private Idaho”.