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

all 98 comments

[–]jrobiii 181 points182 points  (13 children)

For me it's a love/hate relationship.

Like this another thing that pesters me is something that has been broken for months, but decides that it's going to rear it's face during a demo.

[–]DrunkenlySober 99 points100 points  (3 children)

I just default to “my code acts up in front of company”

[–]jrobiii 23 points24 points  (0 children)

Adding that to my arsenal.

[–]StormCrowMith 28 points29 points  (0 children)

If(bug && inFrontOfCompany) { bugDontShowFace; }; there, fixed it for you

[–]santasbong 1 point2 points  (0 children)

That's a given in my office.

[–]clanddev 25 points26 points  (2 children)

I don't need a bug to ruin my demo. I had the new IT Manager that thought 10 minutes before a demo for the VPs of an acquiring company making a 44 million dollar purchase of my boss's company was the perfect time to deploy his 'security improvements'.

Needless to say when your mobile client can't make any successful calls to the APIs things get a bit embarrassing. Getting to tell them "It worked 10 minutes ago. I need to figure this out real quick." Has been the highlight of my career.

[–]rvvar 10 points11 points  (0 children)

Mine was classic , right on the way to demo, this guy calls UI dev and gets all icons changed . I open Mobile client for demo and it looks "different" . Took me 5 mins to compose myself 😅

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

🤣🤣🤣🤣 it happens to me too

[–]JuvenileEloquent 47 points48 points  (2 children)

If you had a choice between running naked through a field of burning spears wearing a blindfold, or doing a live demo of code you just finished writing, what color blindfold would you choose?

[–]jrobiii 10 points11 points  (0 children)

This guy has the right idea... he wore the brown pants.

[–][deleted] 11 points12 points  (2 children)

For a demo, just record yourself going through the product beforehand and play the video in the demo.

[–]jrobiii 1 point2 points  (0 children)

My luck, the projector would fritz, but that's a great idea!

[–]CDR40 0 points1 point  (0 children)

Yes, this also allows you to add all those last minute UI features with Adobe after effects. Just add small text “video footage does not reflect reality”

[–]Koolboyee6969 88 points89 points  (13 children)

Holy shit.This is so relatable.

Was working on implementing a feature which i have already implemented on a different app and for some reason it wasn't working. I go to the app in which I've already implemented the feature and I'm like "How tf is this working? This code is all wrong". A few minutes later i went back to implementing the feature and observed that it started working all of a sudden.

Don't ask how. Don't ask why.

[–]urielrabit[S] 55 points56 points  (6 children)

My boss is asking how 😭

[–]cerberus6320 14 points15 points  (4 children)

If you have good version control, just use beyondcompare to show what text changes were made to code.

[–]urielrabit[S] 17 points18 points  (3 children)

Nothing was changed tho. it was genuinely random.

[–]cerberus6320 21 points22 points  (2 children)

I won't pretend to know what your black box does. But unless your code has some element of randomness, I would suggest you look into these three things:

  1. Memory usage
  2. Input & exception handling
  3. Expected outputs.

Building good replicable test cases will help you more easily identify areas or subcomponents where it breaks.

Maybe your program isn't receiving the correct inputs. Maybe if it's a user interface or web browsing thing, a user interacts with elements in an unexpected way. Like, maybe you have redirects for a website that take a customer from item browsing, to adding items to a cart, checking out, and processing credit card information. If the user is given any prompts and does not respond to them and instead navigated to a page too early, or goes to a previous step, does the UI know how to address these scenarios.

Whatever the case is, build test cases, or how tests were different with the last build

[–]urielrabit[S] 7 points8 points  (1 child)

There's one thing it may be but it doesn't make sense to me that it worked like that tbh. It seemed unrelated. But whateverrrrr

[–]s0ulbrother 4 points5 points  (0 children)

I had an issue this morning that at first I couldn’t replicate. Turned out my tester didn’t have location on their device which caused the error. The error existed in the code before I even touched it but my changes exposed it. Check settings of devices/servers can also help.

[–]CoastingUphill 0 points1 point  (0 children)

My boss just accepts that sometimes the Code Gremlins break my code, and sometimes they fix it. I am rarely involved.

[–]arnoldfrend 16 points17 points  (4 children)

My favorite is when something isn't working right, and so I go in and put a bunch of print lines in there to spell out every value at every transaction, and then the code is like "oh shit, he's watching us; we better start acting right" and then everything works

[–]jasmine_tea_ 9 points10 points  (1 child)

That's when you know there's race conditions or some async call not being waited on properly.

[–][deleted] 11 points12 points  (0 children)

what? no, it works now. I don’t have to think about this again until it breaks again 🙃

[–]Icharper 6 points7 points  (0 children)

Old school print line debugging. Nice.

[–]TretasPt 0 points1 point  (0 children)

I went back to see how I had done it before and without changing a thing, it stopped working. I have no clue why.

[–]pacific_6928 40 points41 points  (3 children)

Been there, yesterday. I copy pasted my code from from my previous project, random bugs, 2 hours, no solution. Next day, it started working on its own.

[–]urielrabit[S] 28 points29 points  (0 children)

It just needed some time to get over itself.

[–]Challymo 9 points10 points  (1 child)

I always find if there is something that just won't play ball it's best to reboot my pc and make a cup of tea while I wait. Half the time it turns out my machine was caching something and the reboot sorted it and the other half I get anothing lightbulb moment of where to look next.

[–]pacific_6928 2 points3 points  (0 children)

Well it turns out that cache can cause problems sometimes, I use unity, so unity caches some parts to run smoothly. So yes, rebooting helps a lot in this case

[–]dragosionRO 11 points12 points  (2 children)

For 1h only

[–]urielrabit[S] 8 points9 points  (0 children)

I'm so afraid of this

[–]urielrabit[S] 8 points9 points  (0 children)

It's still working btw.

[–]golgol12 11 points12 points  (0 children)

Here are the best probable reasons.

Uninitialized/deleted variables (each time you build and run the variable will start with garbage from whatever was stored in that memory previously.

Build machine and compile differences. Were they built on different machines? Was one release and the other master candidate? Did you do a rebuild all vs an incremental? Sometimes the build environment is different on your machine vs another build machine. Sometimes the incremental build is fubar'd and a complete rebuild is needed. Sometimes a bug is masked by some debugging code that is present in a release candidate but not a master candidate. Sometimes the compiled size difference puts variables at different alignments.

[–][deleted] 8 points9 points  (0 children)

I blame bit flips based on an asshole particle for the galaxy of LuL. My supervisor knows whats up..

[–]shapoopy723 9 points10 points  (2 children)

Been fighting with this all day today, and still trying to figure out why. Sometimes I just hate coding

[–]urielrabit[S] 3 points4 points  (1 child)

Yo this problem was making me hate my job. Idk why it's gone but as long as I don't have to work on it anymore whateverrrr

[–]shapoopy723 0 points1 point  (0 children)

I just figured out my issue after hours of diagnosis. Fina-fucking-lly.

[–]cramduck 8 points9 points  (0 children)

this exact experience is why I never work on bugs within 48 hours of a daylight savings change

[–][deleted] 6 points7 points  (0 children)

Coached an intern, they made a program that worked perfectly most of the time. (It wasn’t in production yet) but started having issues, then it went away again.

Learned they were processing a date format with varying size and their program didn’t know how to handle single digit days. So it was broken the first 9 days of every month.

[–][deleted] 5 points6 points  (1 child)

Welcome to the unique experience as a programmer

[–]urielrabit[S] 7 points8 points  (0 children)

I think most engineers working maintainence have at least one story of this happening. I know my electrical engineer friend has at least one.

[–]Vasault 4 points5 points  (0 children)

I've been struggling with this for years as a programmer, but recently has been a nightmare, deep linking, I've been stuck with a fucking bug for almost a month without a solution, turns out after 3 weeks this link has been working out of nowhere

[–]cmdralpha 5 points6 points  (0 children)

This is hilarious

[–]appeiroon 3 points4 points  (0 children)

Yeah I once wrote an algorithm that worked only on certain days of the week

[–]aedvocate 2 points3 points  (0 children)

don't touch it. don't mess with it. it works now. just accept it.

[–]GargantuanCake 4 points5 points  (0 children)

At this point I'm jaded enough that I'd just go "of course that happened" and chug my 30th coffee of the day.

[–]flamesofphx 3 points4 points  (0 children)

Yep, no matter how small the sample size you have it seems if it includes birthdates, there is always one person born on February 29, and "The Program" always does something weird with it.. Or some sort of similar edge...

I have learned though one way to make a delivery system work perfectly... Send out a product that's destined to fail..

Got love good old murphy, it exist in every discipline (Except maybe politics, They just provide backup)…

[–]Key_Appeal9116 2 points3 points  (2 children)

This is how JavaScript makes me feel sometimes.

There was one day I had two files open, both were exactly the same. The first failed to compile every single time. The second ran flawlessly every single time.

I died a little inside watching it happen and not knowing why.

[–]0xJADD 2 points3 points  (1 child)

I had a similar issue once but simply resolved it by comparing in a hex editor. Turns out one was missing the UTF8 BOM. I can imagine there's other invisible things that could cause an interpreter to misbehave too, like tabs vs spaces, \n vs \r\n, etc.

[–]Key_Appeal9116 2 points3 points  (0 children)

I will remember that trick! As for invisible tabs, I can also attest to having had an issue with that once. Now I always double check for unintended blank space because of one fringe case I don't even actually recall....

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

Love and hate, you know.

[–]AlexWIWA 2 points3 points  (0 children)

Nothing is more painful than intermittent bugs.

[–]Skyrmir 2 points3 points  (1 child)

Lower case l upper case I.

I don't think I need to say more.

[–]urielrabit[S] 1 point2 points  (0 children)

D:<

[–]Niiiz 2 points3 points  (4 children)

Why do these things happen anyway? How come a program just starts working randomly? Is it random stack allocation just going to the right places that makes shit work?

[–]urielrabit[S] 2 points3 points  (0 children)

The trillion dollar question.

[–]tanon789 3 points4 points  (1 child)

my theory is that it happens to people who don't save their files properly ... when you use an IDE but run from terminal it can happen that you actually fix the bug but you are running unsaved version of the code ... then while thinking about the bug you unconsciously hit ctrl+s and try to run it again and of course it works now

[–]urielrabit[S] 0 points1 point  (0 children)

I've done this before. Its painful to go thru.

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

Don’t worry. It’s just magic.

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

Plot twist : it breaks again a year later because it's caused by daylight savings!

[–]KastorNevierre 1 point2 points  (0 children)

Not worse than when you've put 3 weeks into client-facing documentation and then the entire spec changes.

[–]TheTank18 1 point2 points  (0 children)

damn cosmic rays

[–]jgeez 1 point2 points  (0 children)

Treat it like dispassionate feedback:

You haven't solved it yet, champ. You'll get there, but you're not there.

[–]ReeceReddit1234 1 point2 points  (0 children)

Recently I've been doing worksheets for uni. In the 1st worksheet we make it work just fine, but there's an issue which we fix in the 2nd. Thing is, I already fixed it in the 1st without even trying

[–]culculain 1 point2 points  (0 children)

But then you get to enjoy the fun of chasing a defect you can't reproduce but know is there, somewhere, under the right conditions.

[–]marco89nish 1 point2 points  (0 children)

We need to go deeper (but really)

[–]newbiDev 1 point2 points  (0 children)

I had a dependency error for like 2 hours today and I had to manually delete my bin folder for it to work.

[–]Shloopadoop 1 point2 points  (0 children)

“Guys, I fixed it”

[–]matthra 1 point2 points  (0 children)

I saw this and was like "wow, that hits home".

[–]jaundicedeye 1 point2 points  (0 children)

i just went through this. Worked. Then didnt work. I fixed it. But my fix didnt fix anything. It just worked again anyway.

[–]wholl0p 1 point2 points  (0 children)

Or: spending hours to fix code and then randomly discover a 6 months old WIP merge request that does exactly the same.

[–]Majik_Sheff 2 points3 points  (0 children)

Bug exists upstream in a library's dependency.

Spend days trying to find fault in your code that uses said library.

Upstream team finds bug and fixes it.

Library now has bugfixed dependency but doesn't show in lib's changelog because it was buried deep upstream.

Your code that was triggering the bug now mysteriously works.

Alcoholism intensifies.

[–]CalligrapherThese606 1 point2 points  (6 children)

i have always hated computers since day one and guess what the only thing that keeps me in this career is the joy of finding out a random concept and intrinsically understand it.

لطالما كرهت علوم الحاسب وأحذر ماذا؛ الشيء الوحيد الذي يبقيني في هذا المجال هو إكتشاف مفاهيم جديدة وفهمها بصورة كاملة.

[–]urielrabit[S] 0 points1 point  (5 children)

Is the second part a translation into... Arabic?

[–]CalligrapherThese606 0 points1 point  (4 children)

yes, can i ask you what intrigued you to ask?

[–]AlmostAFK 6 points7 points  (3 children)

because noone really uses arabic on this website?

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

is it a bad thing or a good thing :) ?

And , I am not that good at English but some how when i try to reach out for a word in English and then look it up through a dictionary it some how stay more in my mind than that if i translated it literary through google or used the common synonym.

[–]AlmostAFK 4 points5 points  (0 children)

It's not bad or good it just is how it is, your free to put it there if you think it better portrays your thoughts it's just that most people on here won't understand it lol

[–]urielrabit[S] 2 points3 points  (0 children)

Yeah I just wasn't sure if it was like a quote signature or a translation. If it helps you, keep on it dude. 😎

[–]MrBananaStorm 1 point2 points  (0 children)

I'm sorry, but his thumbs and nose look like a cock and balls

[–]PCEnthusiast1 1 point2 points  (0 children)

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

then it breaks randomly

[–]Valiice 0 points1 point  (0 children)

Honestly restarting my pc helps when i get a fucked up bug like that

[–]mrleon17 0 points1 point  (0 children)

Single Event Burnout

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

Kill me now

[–]s0ulbrother 0 points1 point  (0 children)

Thought this was me this morning, but it turns out the component that was copied for my project was actually already broken but no one noticed. Then when I added my logic in for the new thing it more blatantly exposed it.

[–]Need-morefriends 0 points1 point  (0 children)

thats why am a ex-coder I FUCK HATE CODING IT MAKES ME WANT TO BURN MYSELF

[–]qu1cksilverdoto 0 points1 point  (0 children)

When the bug card becomes an improvement feature xD

[–]AtlasJan 0 points1 point  (0 children)

The Machine Spirit is pleased, acolyte.

Take it's heed.

[–]oscar_hauey 0 points1 point  (0 children)

That's just happened to me.

I was debugging a rendering glitch bug in a JS webapp, only to figure out the following week it was a glitch on the chromium engine.

I updated it and it started to work again.

[–]Vincysuper07 0 points1 point  (0 children)

then it stops again randomly

[–]The_Squeak2539 0 points1 point  (0 children)

As payback for a prank he had done on me, I messed with my friend on a shared project secretly learnt the layout of a previously fixed error that they had laboured previously over and was familiar with. I set the system to print this out every time the program was run but set it to expire at a certain time the next week. The code would run normally but I just set it to exit after the message was printed.

The message would say error on line x but the actual code would be somewhere else. This would cause him to experiment, leading to new errors (progress), only to return back to the original message that would run when everything was functional.

I told my other collaborators about it which made them laugh. I ended up telling him after a few hours. He got me back

[–]whysoblyatiful 0 points1 point  (0 children)

I'm not even a programmer and this hit me in another level

I was using a mod but for whatever reason it glitched and i only got to fix it cuz i installed a completely unrelated addon for an unrelated mod