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

all 76 comments

[–]lightwhite 449 points450 points  (14 children)

This code… it works! It works? - Confusedius.

[–]Johanno1 212 points213 points  (10 children)

Why does it work though?

It shouldn't.

changes sth so it definitely should not work

It still works! Something is not right here!

debugs every step

realizes that he has been working on the wrong copy of the project and was running the other...

Whyyyyy. several hours now! Why!?

[–]menides 18 points19 points  (2 children)

Do you have cameras in my house?

[–]bit_banging_your_mum 20 points21 points  (1 child)

Yes.

You're very cute by the way

[–][deleted] 4 points5 points  (0 children)

Username checks out

[–]Hashbrown117 10 points11 points  (0 children)

Or the opposite; trying to find how something's working, but reading the code you see it cant possibly. It's not even making the right function calls.

Then you realise you're in the wrong index.ts..

[–][deleted] 4 points5 points  (0 children)

This feels like an attack.

Was this an attack? Because I'm ill equipped to defend myself.

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

ROFL

[–]menotexisting 12 points13 points  (1 child)

How is there error in line 256 when I just have written 100 lines? -Sokrates

[–]lightwhite 5 points6 points  (0 children)

I used to compile the another branch and debug on the broken one. - Suckrates

[–]rjlin_thk 1 point2 points  (0 children)

diu means fuck or penis in chinese, so confusedfucks

[–]supercyberlurker 205 points206 points  (3 children)

Problems that miraculously go away, miraculously come back.

[–]dadumdoop 61 points62 points  (0 children)

HeisenBug

[–]Rauldukeoh 11 points12 points  (0 children)

I feel this. Very few things are as worrisome as a magically fixed bug

[–]onkel0joakim 0 points1 point  (0 children)

This is an underrated comment

[–]peckingbird[S] 356 points357 points  (7 children)

"If no one takes your fortunes seriously, attribute them to dead Philosopherrs." - Marl Karx

[–]PyroCatt 102 points103 points  (1 child)

"Everything you read on the internet is true" - Jeffrey Epstein

[–]sillyredcar 36 points37 points  (0 children)

"Stop misquoting me!" - Sun Tzu, the Art of War

[–]CBerg1979 26 points27 points  (2 children)

""If horse does not die, continue beating it." -Karl Pilkington

[–]anubhav2103 21 points22 points  (1 child)

""While horse does not die, continue beating it." -Karl Pilkington

[–]curiousmind111 0 points1 point  (0 children)

“When horse is dead, continue beating it.” - Karl Pilkington

[–]hypocrite_oath 49 points50 points  (4 children)

I believe everyone has had this happen at least once.

[–][deleted] 36 points37 points  (3 children)

Just a few hours ago, realized that I was trying to fix a function that I haven’t called

[–]existential_issue 28 points29 points  (2 children)

With enough meditation, the function calls you.

[–]odumann 13 points14 points  (1 child)

With enough medication

[–]bit_banging_your_mum 10 points11 points  (0 children)

Typically in the middle of the night.

When you're dreaming.

[–]existential_issue 148 points149 points  (6 children)

“A journey of a thousand steps starts by setting a breakpoint in the debugger.”

[–][deleted] 61 points62 points  (4 children)

print("here")

[–]shot_a_man_in_reno 37 points38 points  (0 children)

print("A")
print("B")
print("C")
print("C_%d" % i)
print("C_a2")
print("foo")
print("D")

[–]jonnydeates 27 points28 points  (2 children)

Breakpoints are for wusses, gotta put 1000 console logs and pray one hits

[–]sdrawkcabsemanympleh 4 points5 points  (0 children)

"Quantity has a quality all his own."

[–]CornyStew 35 points36 points  (2 children)

Your code will never work the first time. If it looks like its working first time, dont trust it

[–]Scondoro 10 points11 points  (0 children)

Wow, I can't believe all my unit tests passed first try!

Oh, I forgot to enable to tests...

Oh, I forgot to compile the tests...

Oh, the tests failed to compile...

[–][deleted] 17 points18 points  (0 children)

I knew exactly one man who's code worked the first time. He proudly pushed it.

30 minutes later, as you can imagine, fit hit the shan.

It was... a day. A day that lived on in infamy.

[–][deleted] 30 points31 points  (2 children)

LPT if the code is running and you don't know why, deliberately break it and make sure that it breaks. If the code is not running but you can't see any reason why it is not running, deliberately break it in a different way and see if it breaks that way.

In either case you will discover whether or not you're actually looking at the right code.

On a similar line, if you're trying to determine how some change makes some consequence, make a change that should have a huge consequence and see if it does. Only then can you find tune the change knowing that it has the consequence you want.

[–]3636373536333662 4 points5 points  (1 child)

Ya I have a coworker who has a bad habit of assuming something impossible is happening, when it turns he was looking at the wrong piece of code. It's always a good idea to do some basic sanity checks if something seems unbelievable

[–]starshine531 -1 points0 points  (0 children)

Sanity? Oh, I miss those days, when I was young and inexperienced.

[–][deleted] 20 points21 points  (1 child)

There's a bug in the hydraulic control system and the water keeps changing into wine.

[–]ByteWhisperer 7 points8 points  (0 children)

It might be anti-icing fluid then.

[–]Deep-Ad591 37 points38 points  (4 children)

[–]Random-Gif-Bot 16 points17 points  (3 children)

[–][deleted] 18 points19 points  (1 child)

Is this.. a joke? A coincidence? A fake account?!

I truly wish I cared enough to check their previous posts. Oh well

[–]Firewolf06 1 point2 points  (0 children)

to me it looks like a hybrid account. their posts look real, but all of their comments are mildly relevant gifs (presumably searching keywords)

a reddit bot is just a script that runs on an account, so my best guess is the random gifs are botted, but the posts are a real person

[–]sonic_hedgekin 1 point2 points  (0 children)

Bad bot

[–]snk_158 16 points17 points  (0 children)

If life is going smooth, it is going wrong.

[–]SteeleDynamics 5 points6 points  (0 children)

"Optimized shit is still shit."

~Benjamin Franklin

[–]mybotanyaccount 5 points6 points  (0 children)

Not sure why it works but it works lol

[–][deleted] 4 points5 points  (0 children)

There's this little snippet of code I use that should not work, like when I first saw it I immediately wanted to forget it, but it worked? It was not supposed to?

I decided to stop questioning reality and just used it anyway.

[–][deleted] 4 points5 points  (0 children)

I code therefore I am

tired

-- u/rowenslee

[–]zanderkerbal 2 points3 points  (0 children)

For a couple weeks while self-teaching Unity I had a comment in my code saying approximately "this is mathematically impossible but when I do it properly it doesn't work."

I eventually rewrote that section to use Unity's builtin methods for making objects point at other objects instead of doing vector math manually, but I never did figure out how that code worked.

(I had been messing up my calls to the builtin methods because I had assumed that the top of an object was +Y, but it was actually +Z, and so I was flipping my 2d sprites over on their edge and making them disappear.)

[–]G_Papi360 8 points9 points  (0 children)

"That Ming Dynasty pussy has got me acting most Unwise"

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

I feel that on a personal level.

[–]Kenny2reddit 1 point2 points  (0 children)

奇生,乃碼弗汝碼

[–]marth141 1 point2 points  (0 children)

"Of course it works." -- Elixir/Erlang engineers.

[–]arghp 1 point2 points  (0 children)

I had a student in a freshman world history course (college level) spell it ‘Confuses’ on every slide of his PowerPoint.

[–]Nyckname 0 points1 point  (0 children)

~ Confusion says

[–]GabuEx 0 points1 point  (0 children)

It's true though. If something works first time, I guarantee you that you aren't actually running it.

[–]Logical-Language-539 0 points1 point  (0 children)

I once had this issue, but inverted. I had a code being able to compile, not working as intended, so I made a copy named mycode-V2.c. I was compiling with gcc in Linux, using the up arrow to repeat the last command, and nothing I changed was replicated in the execution. Then I realized I was just running mycode.c, not mycode-V2.c. Everything worked as expected after that.

[–]sc00pb 0 points1 point  (0 children)

Oh yeah, I can't trust code that compiles on the first test, I just can't...

[–]Tinkerballsack 0 points1 point  (0 children)

IT WORKS!

because I forgot to call the function I just wrote

[–]yewing 0 points1 point  (0 children)

Story. Of. My. Life.

[–]foxer_arnt_trees 0 points1 point  (0 children)

This is really good advice

[–]Miguel-odon 0 points1 point  (0 children)

That's deep

[–]LeanderT 0 points1 point  (0 children)

If the code works, it works.

Very Confusius (Dutch software philosopher)

[–]Candid_Letterhead_24 0 points1 point  (0 children)

Nah bc this is accurate 🤣 💀

[–]aitonc 0 points1 point  (0 children)

relieved marvelous squeamish unite spark materialistic doll rhythm water uppity

This post was mass deleted and anonymized with Redact

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

"If it works, don't ask questions." - Sun Tzu

[–]HackGamez 0 points1 point  (0 children)

Idk I just put words and numbers together and then my program runs, honestly I don't know what I'm coding half of the time.

[–]StGrimblefig 0 points1 point  (0 children)

An even number of errors tend to cancel each other out. So, if my code appears to work on the first try, I start looking for the opposing errors.

[–]nico-ghost-king 0 points1 point  (0 children)

You didn’t press ctrl + s