r/ProgrammerHumor • • Jan 02 '22

Debugging Code Be Like.

58.4k Upvotes

283 comments sorted by

2.9k

u/Flopamp Jan 02 '22

"WHY THE HELL IS THAT THREAD COMPLAINING ITS NOT EVEN PART OF THIS"

1.2k

u/Jasdac Jan 02 '22

"What do you mean error on line 59? THERE ARE ONLY 20 LINES OF CODE"

210

u/Scyobi_Empire Jan 03 '22

I know that pain

0

u/[deleted] Jan 03 '22

[deleted]

65

u/Drauxus Jan 03 '22

Then you realized you didn't hit save before debugging and your 20 new lines of code weren't even being compiled.

→ More replies (2)
→ More replies (3)

26

u/soguesswhat Jan 03 '22

I'm guessing this was the Lua

4

u/Hessalam May 13 '22

Lua is so wild. Failed arythmatic in :39: but the entire function only uses math.random and a single if statement.

11

u/Mysterious-Drop1155 Jan 03 '22

Yeah the shell just adds some random number of line to the error code and it’s fucking stupid

10

u/Dino_Soup Jan 03 '22

And that's why there is an error. Code can't find line 59.

5

u/doyouseewhateyesee Jan 03 '22

probably common sense at this point but it usually means the error is coming from an imported package

→ More replies (2)

288

u/[deleted] Jan 02 '22

That would be because you haven't discovered Rust yet :)

142

u/AVTOCRAT Jan 02 '22

How would Rust be particularly helpful in this scenario? Sure, it'd prevent memory corruption, but the most common case for an unrelated thread to break is (in my experience) usually down to an earlier misbehavior by one thread which only shows up down the line in a connected one. Nothing that the borrow checker can do to fix that.

72

u/pigeon768 Jan 02 '22

This circle ain't gonna jerk itself. Get back in the pile.

→ More replies (5)

75

u/[deleted] Jan 02 '22

I think probably the most common reason for seemingly unrelated threads breaking is hidden shared state / aliasing, and race conditions, both of which Rust is good at preventing...

43

u/Numerlor Jan 02 '22

Rust won't do shit for race conditions, it can only prevent data races

→ More replies (12)
→ More replies (1)

4

u/Cat7o0 Jan 03 '22

"This problem shouldn't even be possible." " Oh shit I was looking in the wrong place"

1.8k

u/waremi Jan 02 '22
  1. You sub-classed your panda wrong and

  2. The code that is actually running is not the code you have been staring at for the past hour.

944

u/Quack69boofit Jan 02 '22

Number 2 hurts me to my core

450

u/i3908 Jan 02 '22

Eat more fiber my friend

133

u/[deleted] Jan 02 '22

[removed] — view removed comment

0

u/[deleted] Jan 02 '22

[deleted]

0

u/[deleted] Jan 02 '22

[deleted]

→ More replies (2)

76

u/N00N3AT011 Jan 02 '22

"WHY THE FUCK ISN'T THIS WORKING"

looks at tabs in editor

"oh"

40

u/DefaultVariable Jan 02 '22

What’s worse is keeping two versions of a project open at once, one being the released and one being the dev, accidentally modifying both with different sets of changes, testing the one in dev, then deploying the full changes and suddenly nothing works. When you realize what happened… ugh

70

u/mindbleach Jan 02 '22

The software equivalent of telling an artist, "wrong layer."

12

u/marxinne Jan 03 '22

That's why I quit digital painting and went to acrylics and gouache

22

u/mindbleach Jan 03 '22

And then you reach for ctrl+z and weep.

→ More replies (3)

21

u/spainman Jan 02 '22

Hurts me right in the kernel

8

u/japirate777 Jan 02 '22

Setting the wrong starting scene in Godot Moment

3

u/computergeek125 Jan 03 '22

Check if it created a core dump, you might be able to load that into the debugger

→ More replies (4)

102

u/trwolfe13 Jan 02 '22

I spent an entire day trying to debug how a database record was seemingly randomly being updated during a workflow recently. Eventually discovered there was a whole other service doing its own thing that was updating it.

21

u/[deleted] Jan 02 '22

Locking where?

32

u/trwolfe13 Jan 02 '22

Hah. Good one. To give a bit more context, it was a document in a Cosmos database that was being updated. It doesn’t have locking as such - there’s a GUID that gets regenerated each time a document is updated that is used to detect conflicts, but it can be ignored.

The team that designed the system I work with built multiple independent services that all make changes to the same dataset. There’s no locking, no retry mechanism, no meaningful way of handling concurrency at all. Issues like this are quite common, but the architecture is so fundamentally flawed, that making any type of long term fix requires substantial rewriting.

16

u/[deleted] Jan 02 '22

That sounds awful!

8

u/Sir_Applecheese Jan 02 '22

Good luck dude.

5

u/[deleted] Jan 03 '22

That sounds like a terrible design, I've always heard of the One database per service principal. One schema per service is fine, but to have multiple concurrent services accessing the same dataset, like why

→ More replies (1)
→ More replies (2)

16

u/Kyouma118 Jan 02 '22

I felt that...

9

u/rudolfs001 Jan 02 '22

Break points and step throughs baby, all day long

2

u/I_l_I Jan 02 '22

This isn't exactly what pandas was built for anyway

1

u/cowlinator Jan 03 '22

3. The file you have been editing for the last 30 minutes is actually in a different copy of the project than the one you are running

1

u/[deleted] Jan 03 '22

3. You accidentally forgot your closing parentheses on the main method and the compiler won't show all 1000 errors, only the last 100

1

u/tcpukl Jan 03 '22

The Callstack in this crash dump couldn't possibly exist. This function has never called this code.

Oh, it's an optimised call stack.

1

u/42TowelsCo Jan 03 '22

Fuckn JS caching where the JS code in browser doesn't get updated and you don't realise for an hour.

→ More replies (2)

0

u/[deleted] Jan 02 '22

[deleted]

→ More replies (1)

7

u/[deleted] Jan 02 '22

[removed] — view removed comment

5

u/RenaKunisaki Jan 03 '22

I was wondering why it didn't generate any warnings...

460

u/feidujiujia Jan 02 '22

This was what led me to watch the whole episodes of we bear bears

171

u/LegaiAA Jan 02 '22

Such a good show.

55

u/Bakoro Jan 02 '22

There's a We Baby Bears show now too.

18

u/Osirin111 Jan 02 '22

is it good tho?

20

u/GoldFishPony Jan 02 '22 edited Jan 03 '22

I’ve not watched the show at all but the opening song is great

→ More replies (1)

6

u/OzzieBloke777 Jan 03 '22

Not as good as the original series but that's just my opinion.

46

u/demandtheworst Jan 02 '22

I watched it with my daughter once, and was disappointed she didn't want to watch it the next day, or indeed ever again. One of the good ones.

11

u/kenman884 Jan 03 '22

I pretend the remote is broken and we can only watch Bluey instead of Puppy Dog Pals. Might have to see if the remote will work for this show too.

→ More replies (1)

4

u/Holocene32 Jan 03 '22

Where can I watch it? Netflix?

3

u/[deleted] Jan 03 '22

Yes!

→ More replies (1)

3

u/[deleted] Jan 03 '22

The first episode with the pigeon gang stealing shit had me hooked

→ More replies (1)

223

u/RoseRedCinderella Jan 02 '22

Lmao our programming professor showed us this gif when discussing testing

28

u/ThaiJohnnyDepp Jan 03 '22

It's been here on PH like three times. A prof showing it confirms it's reached "forwards from Grandma" status

8

u/anti-pSTAT3 Jan 03 '22

Why is grandma on pornhub?

360

u/dywkhigts Jan 02 '22

This is adorable

0

u/[deleted] Jan 02 '22

[deleted]

7

u/dragonwp Jan 02 '22

I’m reminded of the pillow episode with the firefighter <3

166

u/[deleted] Jan 02 '22

[removed] — view removed comment

19

u/ViolentHiro Jan 02 '22

Tote life!

261

u/MylastAccountBroke Jan 02 '22

"What the hell?"

"What the hell!"

"WHY ARE YOU WORKING NOW!"

58

u/[deleted] Jan 02 '22

feels like debugging python in a sh*tty PC, the thing that wont work few minutes ago decide to work after debugging unrelated lines.

32

u/Nebuchadnezzer2 Jan 03 '22

Removing only a commented line, breaks.

Ctrl+Z line back in, works again.

Confusion intensifies

18

u/UlyssesOddity Jan 03 '22

I once had a perfectly legit-looking multi-line C macro that drove me crazy for nearly a week -- it wouldn't compile. If I retyped it completely from scratch it worked, but if I then Ctrl+Z-ed back to the original it wouldn't.

Turned out that the original macro had a space after a continue-line backslash.

6

u/[deleted] Jan 03 '22

Why would you ever ctrl+z if it worked? I'm just now learning programming. Am I too much of a beginner to understand this?

→ More replies (3)
→ More replies (1)

9

u/infiniteStorms Jan 02 '22

it’s always been working, you’ve just been running the wrong program when testing it

7

u/marimbajoe Jan 02 '22

The last one is entirely too relatable. Tweaking code for hours, cant get shit to run, go take a break to clear my mind and come back, code just works. No idea why the fuck it works, but I'm now afraid to touch it, lest it stop working again.

105

u/whiznat Jan 02 '22

This is true. And you know you've found the cause when the question is no longer "Why isn't this working?" but instead "How did this ever work?"

62

u/[deleted] Jan 02 '22

Well in this situation it’s easy, because the answer is it’s always fucking pandas. Fuck that damn library.

15

u/Intrepid-Sir-7847 Jan 03 '22

Hermione Granger saying fuck libraries? The audacity

31

u/RepostSleuthBot Jan 02 '22

Looks like a repost. I've seen this image 12 times.

First Seen Here on 2018-06-11 92.19% match. Last Seen Here on 2020-03-06 93.75% match

Feedback? Hate? Visit r/repostsleuthbot - I'm not perfect, but you can help. Report [ False Positive ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: False | Target: 86% | Check Title: False | Max Age: Unlimited | Searched Images: 281,529,793 | Search Time: 0.96078s

23

u/[deleted] Jan 02 '22

Huh only 12?

30

u/demonslayer9911 Jan 02 '22

☞ ̄ᴥ ̄☞

18

u/waves_under_stars Jan 02 '22

Funny every time

16

u/schteppe Jan 02 '22

Unit testing when there is a global variable in the code

16

u/tiefling_sorceress Jan 02 '22 edited Jan 02 '22

Hitting the left knee causes the bear to react. Hitting the right knee causes every other bear to react. Clearly the problem here is a lack of documentation

Marked as Fixed (Works as Intended)

15

u/Jzchessman Jan 02 '22

I thought “at least the brown bear is normal” and then realized NO WAIT SHE HITS THE LEFT LEG AND HE RAISES THE RIGHT LEG

13

u/Chubbstock Jan 02 '22

hits bear 3 again

Bear 1 dies

→ More replies (1)

25

u/TheAdvFred Jan 02 '22

Man if that isn’t relatable

10

u/BlueVixensBlur Jan 02 '22

Bug #50019: fix delayed reaction on the first two and no reactions on the last one.

30

u/cubei Jan 02 '22 edited Jan 02 '22

Why did she hit the left knee on the last bear, when she tried right on the others?

Edit: see my answering comment

48

u/cubei Jan 02 '22

Probably for code coverage

30

u/[deleted] Jan 02 '22

You forgot to switch accounts

11

u/cubei Jan 02 '22

Got the idea after I posted. Thought about editing my post, but then thought I just add it as another comment.

→ More replies (6)

6

u/digitalasagna Jan 02 '22

So she wouldn't obscure the other two

8

u/Sigg3net Jan 02 '22

Strongly coupled indeed.

23

u/tasnim_alam_bd Jan 02 '22

5

u/[deleted] Jan 02 '22

relatable

1

u/htmlcoderexe We have flair now?.. Jan 03 '22

Why is the other bird doing an ahegao face

4

u/Denaton_ Jan 02 '22

Pointers at it finest form

4

u/HeartoftheHive Jan 02 '22

Part of the blame comes from inconsistent testing. To measure results, you need to copy the input exactly. Taps right knee, taps right knee, taps left knee. Of course there will be issues.

7

u/Ravens_Quote Jan 02 '22 edited Jan 02 '22

The nurse is walking with her back mostly towards her patients, who are on her left. To compensate for this, she has to continuously look left to keep them in sight for most of the gif.

When something behind her and on her left occurs (the first two bears lifting their legs) she looks further right to view this.

She also tests the left leg on the first two bears, but inexplicably tested the right leg on the third bear instead. This inconsistent testing is bound to leave some oddball feedback that ultimately tells you little about what’s wrong with the bears.

TLDR: Make sure your diagnostic program is running correctly.

2

u/sam01236969XD Jan 02 '22

viatnam flashback

2

u/Bibel_Joe Jan 02 '22

I know a few people who have a bug similar to the panda, only with their right arm ...

2

u/vybezlo Jan 02 '22

It’s worse when you try to make an account on StackOverflow to attempt to garner some help, and even StackOverflow gives you an error when registering.

2

u/Pizzaguy2479 Jan 02 '22

I don’t even code I just thought this was cute

2

u/MikeWilson21 Jan 02 '22

Good it’s working

Okay, just a small fix but it’s in the right direction

Oh what the fuck did I do now

2

u/Ill-Ad-503 Jan 02 '22

did panda just hail?

2

u/jedbrooke Jan 02 '22

one time I ran into a thread deadlock bug... in a single threaded program. Turns out it was just gradle being dumb

2

u/noodleoliver Jan 02 '22

Lol pretty accurate lol the bears are all cute and perfect as they are. No need to debug.

2

u/jayz3d Jan 03 '22

What is the name of that show in the GIF?

3

u/TharoRed Jan 03 '22

We Bare Bears

3

u/FlightUpper6981 Jan 02 '22

When you delete one code from your game and your entire computer system gets deleted

5

u/HighOnBonerPills Jan 02 '22

How much code is "one code"?

2

u/ChocoPuppy Jan 03 '22

A fifth of a coffee.

→ More replies (1)

1

u/Lizlodude Jan 02 '22

Oh wait, it was the one who was in here 5 minutes ago, he was out of order.

1

u/walnoter Jan 02 '22

No no no no no

1

u/BugsRFeatures2 Jan 02 '22

I love this show!

1

u/goomba870 Jan 02 '22

And that’s how I first learned static variables are bad.

1

u/[deleted] Jan 02 '22

So true though 😂

1

u/idiotuseless42 Jan 02 '22

I can't tell how many times I yelled at my computer saying "what is wrong with you?", which just shows that I have lost my sanity a long time ago

1

u/DarkCreeperKitty Jan 02 '22

Me vs all my thoughts

1

u/Statement-Think Jan 02 '22

“It just works.”

-Bethesda

1

u/Important-Tea-9942 Jan 02 '22

"Well, what did you expect to happen?" they said.

1

u/TemporaryUser10 Jan 02 '22

Yes though, it's true

1

u/Heinous_ Jan 02 '22

The last ones Java

1

u/Akul_Tesla Jan 02 '22

All right this post was good enough everyone go find a friend and make them up vote this

1

u/[deleted] Jan 02 '22

Multithreading in a nutshell

1

u/[deleted] Jan 02 '22

it gets worse

1

u/[deleted] Jan 02 '22

Except they're all the very same animal

1

u/Tomfissh Jan 02 '22

Whilst I generally dislike this show. It does have some very clever moments.

1

u/Bucky_bared Jan 02 '22

Man I’m old

1

u/fruttel Jan 02 '22

Is it just me or is that panda's arm a bit to straight

1

u/wsco7730 Jan 02 '22

When your compile button is actually compiling your other project

1

u/Kyocus Jan 03 '22

Action at a distance pisses me off!

1

u/myfunnies420 Jan 03 '22

Debugging via print statements maybe

1

u/good_little_whore Jan 03 '22

my reddit actually crashed on the last one, like it actually did and i thought someone found another mp4 bug or something

1

u/ShortThought Jan 03 '22

ahem

console.log

1

u/[deleted] Jan 03 '22

Can't find anything more relatable than this

1

u/Poseidonram1945 Jan 03 '22

God I love that show.

1

u/malonkey1 Jan 03 '22

"Okay, maybe there's an off-by-one with a pointer somewhere, fine..."

"Hm... maybe it's calling the wrong function? Not sure how that happened."

"Okay come on how the fuck, that shouldn't even be touching the same memory."

1

u/QuarantineSucksALot Jan 03 '22

There could be a boss lurking in there

1

u/Zebra-Kangaroo Jan 03 '22

That's just bad OOP. They should have followed a good design pattern.

1

u/Super13 Jan 03 '22

U/savevideobot

1

u/yemji Jan 03 '22

Debugging makes me wanna quit.😔😔

1

u/BassSLAPPS Jan 03 '22

Yo panda kinda got a nien out ten

1

u/QuarantineSucksALot Jan 03 '22

Like when one of the uncensored printing groups

1

u/Dwobdo Jan 03 '22

40 years ago I was testing a large program and the line number on which I kept getting an error was a comment line. I tried adding superfluous lines and removing lines…no matter what I did I always got an error on the same comment line when I ran the program. Drove me nuts.

Turns out the compiler couldn’t handle more than 16,000 lines of source code. IBM had to put out a temporary fix and then it worked great.

1

u/[deleted] Jan 03 '22

Welcome to timing errors. The best is when timing errors only occur when you take the debug statements out

1

u/greenSixx Jan 03 '22

Lol, yeah

1

u/[deleted] Jan 03 '22

99 little bugs in the code 99 little bugs

Take one down, patch it all out, 128 little bugs in the code

1

u/le_bonker Jan 03 '22

Its his c*ck that moves

1

u/MineAndCraft12 Jan 03 '22

// removing melon.jpg in the root directory causes this line to crash the entire program. May God help us all.

j += 2;

1

u/RoscoMan1 Jan 03 '22

Electromagnetism.

The entire transport situation felt really weird.

1

u/HistoricalMission587 Jan 03 '22

"WHY IS THAT THREAD COMPLAINTING IF IT'S NOT EVEN PART OF THIS?"

1

u/tcpukl Jan 03 '22

Lol, sometimes.

1

u/[deleted] Jan 03 '22

I had a bug about 2 weeks ago where a pointer just randomly changed and I found out that it changed when a random array THAT'S NOT CONNECTED TO THE OTHER ONE IN ANY WAY overflowed. I love C.

1

u/GrimmRadiance Jan 03 '22

And then you do it again and it works fine and you start the cold sweat

1

u/haikusbot Jan 03 '22

And then you do it

Again and it works fine and

You start the cold sweat

- GrimmRadiance


I detect haikus. And sometimes, successfully. Learn more about me.

Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"

1

u/jpc0za Jan 03 '22

Here's one from last night... Debug build runs perfectly no bugs.

Release build(cpp -o3) app doesn't run at all, like nada but no errors, app just happily closes with return code 0.

Forgot to call the initialiser on a class... The debug build did it implicitly but in release needs to be explicit.

1

u/ieatpickleswithmilk Jan 03 '22

This is just counting to 3 in binary (reversed). Each bear is 1 bit.

1

u/Jax12458 Jan 03 '22

I took a coding class in high school let's just say that coding is not my strong suit

1

u/[deleted] Jan 03 '22

We bear debugging

1

u/QuarantineSucksALot Jan 03 '22

Like chaps said it’s great mysteries

1

u/Hellow2 Jan 03 '22

We can surely say that the program is reading the values correctly, and all body parts can move perfectly. That means the part picking up the value "is_punched" is sending the call to the wrong function.

1

u/RoscoMan1 Jan 03 '22

Rubber Duck Debugging, but for it to refresh

1

u/Renusek Jan 03 '22

Once (yes, let's say it was only once) I had some annoying bug, I had no idea what was causing it, so I started removing newly added code, still happening. More code removed, same thing. After I removed like 60% of code, I noticed that I had a typo somewhere.

1

u/[deleted] Jan 03 '22

Panda a nazi?

1

u/QuarantineSucksALot Jan 03 '22

That, and the Nuremberg Code.

1

u/thecodinghedonist Jan 03 '22

That is so damn relatable

1

u/ophir_botzer Jan 04 '22

I know right

1

u/MTDninja Jan 18 '22

When you don't decouple systems

1

u/[deleted] Jan 22 '22

Here's me trying to make a simple addition program only to create a singularity in my cpu

1

u/[deleted] Jan 24 '22

We Bare Bears

1

u/N0tH1tl3r_V2 Jan 24 '22

error on %s on module %s

1

u/DonYurik Jan 30 '22

Tomorrow it's my turn to post it