this post was submitted on 16 Nov 2023
615 points (99.7% liked)

Programmer Humor

19480 readers
202 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 21 comments
sorted by: hot top controversial new old
[–] [email protected] 63 points 11 months ago (2 children)

My biggest problem isn't discovering my own crime. It's trying to determine what my motive was at the time.

[–] [email protected] 27 points 11 months ago

"I plead insanity"

[–] [email protected] 13 points 11 months ago

Usually my motive is, "It's 3am I'll just put this temp placeholder here and fix it in the morning."

Proceeds to not fix it due to forgetting by the morning

[–] [email protected] 38 points 11 months ago (2 children)

You're sure that there was a crime? You're fortunate that your bug is consistently reproducible.

[–] [email protected] 37 points 11 months ago (1 children)

My "favorite" is when following the steps to reproduce a specific bug you get an entirely different bug then what was reported

[–] [email protected] 6 points 11 months ago

Actually think about that shit when I'm trying to sleep

[–] [email protected] 6 points 11 months ago (1 children)
[–] [email protected] 1 points 11 months ago

Git blame would like to have a word with you.

[–] [email protected] 25 points 11 months ago (1 children)

Image Transcription: YouTube Comment


@davidm.313

"Debugging. The game where you are the criminal, the victim, and the detective at the same time. But you probably don't know where the crime took place, or what it was. But there definitely is a crime."


I am a human who transcribes posts to improve accessibility on Lemmy. Transcriptions help people who use screen readers or other assistive technology to use the site. For more information, see here.

[–] [email protected] 5 points 11 months ago

Good human.

[–] [email protected] 9 points 11 months ago

Hey. Sometimes the bug is in a third party library. I didn't do it. I swear!

[–] [email protected] 8 points 11 months ago (1 children)

I know there's a crime because my code runs, but it doesn't do what I asked it to do.

[–] [email protected] 4 points 11 months ago

The fact that it runs means that it has something delinquent to it. Otherwise it wouldn't run. Better run after it and catch it. /j

(That was a bad pun and I am not sorry. It's 3 am here and I can't sleep. This helped me to burn a minute. Thank you.)

[–] [email protected] 6 points 11 months ago (1 children)

thank god that there's a print function in every language.

[–] [email protected] 6 points 11 months ago (2 children)

The worst is when you're print statements aren't outputting where you expected them to, and you have no idea where they're outputting to.

[–] [email protected] 3 points 11 months ago

I tought myself programming as a kid in the 80s and 90s, and just got used to diagnostic print statements because it was the first thing that occurred to me and I had no (advanced) books, mentors, teachers, or Internet to tell me any different.

Then in university one of my lecturers insisted that diagnostic prints are completely unreliable and that we must always use a debugger. He may have overstated the case, but I saw that he had a point when I started working on the university's time-sharing mainframe systems and found my work constantly being preempted and moved around in memory in the middle of critical sections. Diagnostic prints would disappear, or worse, appear where, in theory, they shouldn't be able to, and they would come and go like a restless summer breeze. But for as much as that lecturer banged on about debuggers, he hardly taught us anything about how to use them, and they confused the hell out of me, so I made it through the rest of my degree without using debuggers except for one part of one subject (the "learn about debuggers" part).

Over 20 years later, after a little professional work and a lot of personal projects and making things for other non-coding jobs I've had, I still haven't really used debuggers much. But lately I've been forcing myself to use them sometimes, partly to help me pick apart quirks in external libraries that I'm linking, and partly because I'd like to start using superscalar instructions and threading in my programs, and I remember how that sort of thing screwed up my diagnostic prints in university.

[–] [email protected] 1 points 11 months ago

Even worse is when print statements cause the bug..

That was me before discovering interrupt safe print functions.

[–] [email protected] 6 points 11 months ago

Its usually a typo lol

[–] [email protected] 6 points 11 months ago

I'm not sure if this is a direct quote from Your Code as a Crime Scene, but it's a good book and takes this same stance!

[–] [email protected] 4 points 11 months ago

You could technically do this just like how GTA Vs gameplay was with all the different characters.

[–] [email protected] 2 points 11 months ago

Well, seems like coding while drunk didn't help this time.