this post was submitted on 22 Jun 2023
611 points (98.9% liked)

Programmer Humor

32710 readers
294 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
all 30 comments
sorted by: hot top controversial new old
[–] [email protected] 29 points 2 years ago (3 children)

Stage 4.5: console.log() everything.

[–] [email protected] 16 points 2 years ago (2 children)

And then the logging fixes the subtle timing issue causing the problem.

[–] [email protected] 8 points 2 years ago (1 children)

Race conditions are the worst

[–] [email protected] 1 points 2 years ago

Good ol’ Heisenbugs.

[–] [email protected] 1 points 2 years ago

Especially if logging ends up spreading a global mutex around the log file.

[–] danc4498 9 points 2 years ago

We have logging software built in, but I can never remember how to turn it on, so I just console.log

[–] [email protected] 6 points 2 years ago* (last edited 2 years ago)

Step 4.6: Get another drive for the logs.

[–] [email protected] 14 points 2 years ago (1 children)

console.log("Does it happen here?")

[–] jcg 1 points 2 years ago
print_r($object);die();
[–] fubo 12 points 2 years ago

"I notice that I am confused, and thus that one of my beliefs is fiction."

[–] axtualdave 11 points 2 years ago

Everyone always skips the last step, but that's where you learn.

[–] dan1101 10 points 2 years ago

How did that ever work, I've been there many times.

[–] macgregor 8 points 2 years ago (2 children)

Get enough experience and you just have a brief moment of stage 3 as you dive straight to stage 4.

Unless it's a customer/that-one-guy-at-work (it's a title, but there's usually a handful of them) and then there's this vast stage 0 of back and forth of "are you sure that's happening, run these commands and paste the entire output to me" to be sure of what they are saying then you jump to stage 3/4.

[–] [email protected] 4 points 2 years ago

I jump straight to step 6

[–] meekah 1 points 2 years ago

Yeah honestly who ever starts at stage 1 is a bad programmer IMO. Unless you get your bug reports from the general public, it's unlikely that someone is lying in their bug report. Being at stage 1 pretty much means you have too much confidence in your product.

[–] [email protected] 7 points 2 years ago

Every time that last part happens I have to check the proper spelling of Berenstain. I've had some that really seem like they should have been impossible lol

[–] [email protected] 7 points 2 years ago

its funny i see this now, after spending 3 hours debugging D:

[–] [email protected] 7 points 2 years ago (1 children)

My boss does 1 <--> 2 with us over most every bug any of us has ever found. Ticking time-bomb...

[–] meekah 1 points 2 years ago

sounds like a shit boss tbh

[–] [email protected] 6 points 2 years ago (1 children)

I have some Excel VBA scripting that I've been on 1-4 for a while now, so there's a branch off of 4 that should be "fuck it, here's the workaround" or "that part isn't that important anyway, ignore it".

(it's actually not Excel that's the problem, it's the change to its call to IE that throws up a stupid security warning.)

[–] [email protected] 2 points 2 years ago

Oh my god this comment gave me an aneurysm

[–] [email protected] 6 points 2 years ago

As true as true can ever be

[–] [email protected] 5 points 2 years ago (2 children)

if (0 === 0) {
var_dump($test); die;
}

[–] [email protected] 2 points 2 years ago

Ahhhhh, PHP.... 😭

[–] perviouslyiner 1 points 2 years ago

if ((x != x) || (x == x+1)) then it's one of those weird numbers

[–] egeres 4 points 2 years ago* (last edited 2 years ago)

Stage 7: Who wrote this?

Stage 8: Ah ok... it was me

[–] [email protected] 3 points 2 years ago (1 children)

One of the best pieces of advice I have ever gotten was to build diagnostics first. The time it takes to do will pay for itself 100X over the course of development.

[–] [email protected] 2 points 2 years ago

100% unit tests ftw

Hate making them, love them when they are here

[–] ZcaT 2 points 2 years ago

Has it ever!?