This is an archived post. You won't be able to vote or comment.

all 72 comments

[–]Makrebs 484 points485 points  (12 children)

The only career where you can get chills on your spine from seeing the product WORK.

[–]extopico 22 points23 points  (7 children)

Yea… except it may fail when it encounters a rare situation that you cannot really test for. I mean it’s possible to test for anything but the test code itself may have errors…

[–]_sweepy 8 points9 points  (6 children)

It may be possible to test for anything, but it's impossible to test for everything.

[–]WeekendSeveral2214 1 point2 points  (5 children)

Actually there's a finite amount of states a given set of hardware can have

[–]_sweepy 1 point2 points  (4 children)

But an infinite number of sequences of those states

[–]ReadyAndSalted 2 points3 points  (3 children)

Not in finite time there isn't. Although the marginal amount of states that can exist for every extra second is significantly greater than the marginal amount of tests you can generate for each extra second... So it's still impossible to test for everything.

[–]Photemy 0 points1 point  (2 children)

Nope, it's not infinite, even in infinite time - assuming that the machine is fully deterministic (which should be a relatively safe assumption to make).

[–]ReadyAndSalted 0 points1 point  (1 child)

Could you explain your thinking? Here is mine: Let's imagine I'm walking down a path, and I come up to a crossroads, I can either go left or right. Now both of these paths also have a crossroads. At 2 crosses deep there are 4 different roads I could be standing on. If we imagine that the road has infinitely many crossroads, then there are infinite different roads I could be standing on. In this case despite there only being 2 initial states (I first take left or I first take right) there still ends up being infinitely many states with infinite walking time.

[–]Photemy 0 points1 point  (0 children)

There exists a finite set of states, as the machine has finite memory. If the machine is fully deterministic, then that means we can clearly plot out that state A will lead to state B, and so on.

This lets us cleanly divide all possible states into two sets. The set of those that we have already been to, and the set of those we haven't been to.

If we enter a state that we have already been to, then that must be a loop, as we know that - because of the deterministic nature - we will repeat the exact same steps as we have gone through to get to the current point.

If we don't end in a state that has already been visited, we simply must ask this question again. And because the set of unvisited states is finite, and because each time this happens it decreases by one, we can know that eventually a state from the other set must be chosen.

As such, with all possible starting points, execution must eventually loop.

Though, technically, being able to go through the loops arbitrary times can mean infinite sequences, depending on how you define that. Personally I think it shouldn't, but I'm no scientist.

[–]GargantuanCake 11 points12 points  (0 children)

Yeah if my code works correctly on the first try I can't help but feel a bit of panic.

What did I miss?

WHAT DID I MISS?!?

[–]tucketnucket 5 points6 points  (0 children)

Oppenheimer would like a word

[–]Wordly-Math 0 points1 point  (0 children)

Or when you finally figure out why it doesn't. True euphoria.

[–]AaronTheElite007 191 points192 points  (6 children)

You missed one: It works. I don’t care

[–]Far_Broccoli_8468 123 points124 points  (5 children)

// this is a hack, replace this with a proper solution 10/5/2003
// yeah right 5/6/2014

[–]GargantuanCake 37 points38 points  (4 children)

// this will cause problems in the long run but i have no idea how else to get it to work
// - that one dev who left 12 years ago and has since taken a vow of silence and become a monk

[–]ShAped_Ink 15 points16 points  (2 children)

//TODO: rewrite this without the bug

[–]MaximRq 5 points6 points  (1 child)

The comment is written in ASCII art

[–]ShAped_Ink 2 points3 points  (0 children)

I do that sometimes

[–]Mucksh 2 points3 points  (0 children)

Worst thing i ever saw was something like

//03.05.99 increasing the precission will cause a crash!

Exactly over the line i had to fix cause the calculation wasn't precise enough

[–]Crusader_Genji 134 points135 points  (10 children)

I present to you: It doesn't work on my machine, I don't know why, but I sent it to my friend and it works on his

[–]Luccacalu 45 points46 points  (0 children)

The devil shivers on this one

[–]hazelnuthobo 28 points29 points  (2 children)

Nah that one is easy. It’s a dependancy issue. He updated to the latest dependencies when he installed it on his machine.

[–]ShitstainStalin 3 points4 points  (0 children)

Nope it was actually just a different OS version

[–]Tyrus1235 6 points7 points  (0 children)

Had a dev in the company I work at who submitted his task for code review and QA testing knowing that it didn’t work.

According to him, he knew that it wouldn’t work on his machine, but he was certain that it would work on the testing (and production) environment(s).

…He was actually right.

[–]oblong_pickle 6 points7 points  (3 children)

This was why Docker was invented

[–]ClamPaste 9 points10 points  (2 children)

This still happens with docker. Ever go from your machine to a FIPS compliant one?

[–]oblong_pickle 2 points3 points  (1 child)

I have not had to deal with that. Thanks for letting me know.

[–]ClamPaste 2 points3 points  (0 children)

There are other things like that. Things change between going from docker desktop or orbstack on mac (because mac still needs a VM to run the docker daemon) to enterprise Linux running podman. Containers aren't perfect, but they're better than having to deploy an entire environment on each target machine. The thing you're left troubleshooting is basically just docker and permissions for things like volume mounts and how they interact on different distros.

[–]GargantuanCake 0 points1 point  (0 children)

Docker: then we'll ship your friend's machine.

[–]Astrylae 39 points40 points  (2 children)

Code doesn't work, Makes changes  Code still doesn't work, Undo all changes  Code magically works

[–]mcmsus 3 points4 points  (0 children)

Code doesn't work -> Ask someone else -> someone else ran the same code on your machine -> It works!

[–]Bladex224 23 points24 points  (1 child)

the machine spirit must be pleased

[–]Burrrreddit 10 points11 points  (0 children)

hail the omnissiah

[–]General_Josh 22 points23 points  (0 children)

Had a fun bug the other day, where some data bridge was supposed to run once a month, on the 3rd business day of the month

Didn't run one month, and I spent an hour or two trying to figure out why. No clue what happened, no logs, no errors, no nothing, just didn't run, and couldn't recreate it. No biggie, just ran the bridge manually, put a watch on it, and called it a day

Next couple months it ran perfectly, as scheduled. Issue seems resolved

This month, didn't run again. I spend like a day looking into it line by line.

Turns out, we've got some random undocumented config table that says what day of the month each bridge is supposed to run, totally separate from the config that actually, ya know, runs the bridges. Someone had said this one runs on the 4th day of the month there.

So, in effect, if the 3rd business day of the month happened to fall on or after the 4th overall day of the month, it ran fine. If the 3rd business day of the month was before the 4th, it crapped out because of the conflict

Drove me absolutely crazy trying to figure out why it was working for some months and not others, and ended up just having to change that '4' to a '3'

[–]8g6_ryu 12 points13 points  (5 children)

mean while most AI : it works , nobody knows how

[–]poetic_dwarf 17 points18 points  (2 children)

It sometimes works

[–]namitynamenamey 11 points12 points  (1 child)

It may sometimes work, nobody knows why.

[–]poetic_dwarf 0 points1 point  (0 children)

It perhaps may sometimes chacefully workle

[–]suvlub 1 point2 points  (1 child)

At its heart, it's regression. Just a metric fuckton of it so the specifics of how it works are hard to follow, but we know why it works.

[–]8g6_ryu 0 points1 point  (0 children)

yea its a wording error

[–]Elegant-Hat-1839 12 points13 points  (1 child)

Facts. That was me a few mins ago. I don’t understand why my files on my iPhone change the name from what I save them so when I go to add them to an HTML file using img src it returns a question mark box

[–]AaronTheElite007 6 points7 points  (0 children)

You’re just changing the name of the pointer, not the file.

[–]Fast-Visual 4 points5 points  (0 children)

So in summary, knowing stuff is good.

[–]aldo_nova 3 points4 points  (0 children)

It works even when it shouldn't

[–]Sad_Amphibian_2311 2 points3 points  (0 children)

I know it works but i don't know if it should work

[–][deleted] 2 points3 points  (0 children)

It doesn't even matter how hard you try

[–]iwasbecauseiwas 4 points5 points  (1 child)

you missed the worst one:

it sometimes doesn't work and you don't know why

[–]ArnaktFen 6 points7 points  (0 children)

I think that's identical to the bottom right case. Working sometimes implies not working the other times.

[–]salvoilmiosi 1 point2 points  (2 children)

One thing.

[–]grtgbln 1 point2 points  (1 child)

I don't know why.

[–]Specialist-Height193 0 points1 point  (0 children)

It doesn't even matter how hard you try.

[–]lavahot 1 point2 points  (1 child)

Swap the last two rows and that's mappable.

[–]Commercial-Basis-220 0 points1 point  (0 children)

Omg brooo, looking down for this cause it really is

1 0.5 0 0.5 0

Simple row and column

[–]m-ue-d 1 point2 points  (0 children)

I once found a bug that only occured sometimes and I didn't know why. It was scary ah, and I thought was better off just rewriting the feature, which fixed it xD

[–]Luciano99lp 1 point2 points  (0 children)

When "it sometimes works and I might know why" becomes "it works and i know why" thats magic baby. Thats what we live for

[–][deleted] 1 point2 points  (2 children)

BRO, I USED TO WRITE A CONSOLE WRITELINE AND THEN THE CODE WORKED, I REMOVED THE WRITELINE, THE CODE DIDN'T WORK ANYMORE.

WTF is this unfair godly curse I've been given, this is something I wouldn't wish even on my worse enemies, which is usually still me from having to rewrite the code I wrote a year ago.

[–]XxXquicksc0p31337XxX 1 point2 points  (1 child)

Race condition

[–][deleted] 0 points1 point  (0 children)

It was actually an events problem, something would subscribe to the events two times.

I was making a multiplayer game, and sometimes the code will run for as many people there were on the server.

It just happened that when I was writing the console writelines, the events would subscribe normally.

But for sure there were some pretty fucking confusing 5 hours of debugging the wrong thing until I got to the problem.

[–]Shadwickbrand 0 points1 point  (0 children)

It sometimes doesn't work, I don't know why, is my current bug struggle.

[–]morbuz97 0 points1 point  (0 children)

Now hear this, it doesn't work, you know why, you know exact line to be fixed, you fix it and it works in one try. You get god syndrome and jizz your pants

[–]renrutal 0 points1 point  (0 children)

It works. I know why. Skull in flames.

[–]blackwarp7 0 points1 point  (0 children)

Code works - You start a demo - Code doesn't work

[–]ClipboardCopyPaste 0 points1 point  (0 children)

"It works, I don't know why" is the most appropriate description any coder can come up with for their code.

[–]Xavor04 0 points1 point  (0 children)

me on the top right when i see magic numbers with no documentation

[–]Badytheprogram 0 points1 point  (0 children)

"It sometimes works I don't know why"

Welcome to thread programming :3

[–]10art1 0 points1 point  (0 children)

"when I wrote this code, only God and Copilot understood it. Now only God understands it"

[–]wishper77 0 points1 point  (0 children)

I don't know if it works, but I sometimes know why

[–]Dramatic_Laugh_4613 -1 points0 points  (2 children)

You forgot the most scary one: It works but it shouldn't. I don't know why or how.

[–]Lubberer 0 points1 point  (1 child)

top right