r/ProgrammerHumor • • Jan 02 '22

Debugging Code Be Like.

58.4k Upvotes

283 comments sorted by

View all comments

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.

18

u/AzireVG Jan 03 '22

That happens after writing 20 more lines to write what you think the fix was

→ More replies (1)

-4

u/[deleted] Jan 03 '22

[removed] — view removed comment

→ More replies (2)

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

1

u/[deleted] Jan 03 '22

[removed] — view removed comment

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 (3)

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

0

u/[deleted] Jan 02 '22

[deleted]

10

u/BarbellJesus Jan 02 '22

Check out the rust book on data races and race conditions

https://doc.rust-lang.org/nomicon/races.html

0

u/[deleted] Jan 02 '22

[deleted]

→ More replies (1)
→ More replies (8)
→ 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"

→ More replies (1)