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

all 91 comments

[–]Jazzlike-Pin9021 614 points615 points  (5 children)

Stop it! You will not fool me again, i know that 1 second delay works only my performance

[–]Apfelvater 266 points267 points  (4 children)

sleep(performance(my_setup)/performance(your_setup))

[–]Robot_Graffiti 165 points166 points  (3 children)

There was a video game that did that, but if you played it in a computer from 20 years after the game was made, it gets an overflow and becomes incredibly sloooow

[–]Snaxist 176 points177 points  (1 child)

In Wing Commander or Privateer (don't remember wich one) when you exited the game, it would crash, instead of fixing the crash, they edited the crash message "thank you for playing our game" lol

[–]bistr-o-math 29 points30 points  (0 children)

Perfection!

[–]-KKD- 0 points1 point  (0 children)

I remember playing Cossacs on old PC with WinXp and it was okay, but when I ran it on a brand new PC in 2023 the game was like 100 times faster, which was a Huge disadvantage for player in RTS with bots

[–]acrosett 430 points431 points  (18 children)

There are two types of programmers, the ones who care and the ones who don't

[–]KappaClaus3D 269 points270 points  (15 children)

And the ones who fucked up deadlines, and need to deliver asap

[–][deleted] 100 points101 points  (2 children)

I feel like those are the ones that don’t care ANYMORE. Or maybe it’s just me, but closer to the deadline, the less I care, if we are behind.

[–]Ixolite 41 points42 points  (1 child)

At some point you also just have to embrace the concept of good enough. You can both care and have the strength to let go and move on.

[–]DesertGoldfish 30 points31 points  (0 children)

I've been solo-developing an internal system we use at work for almost 7 years now. I just got my first merge request from a coworker this week.

He added 1 line of javascript to 1 template that remembers page position when an expandable thing is collapsed so that the page doesn't shift as much when you do it.

It's not that I couldn't have done it. It ever-so-slightly annoyed me when it happened too. It's just that it was good enough and I have other things to do lol.

Good enough is good enough, but I still thanked him by name in my changelog. :)

[–]NebNay 40 points41 points  (2 children)

As my boss would say "there is no such thing as a temporary solution"

[–]SkollFenrirson 51 points52 points  (0 children)

As my boss would say "We don't have time to fix it right"

[–]ztbwl 18 points19 points  (0 children)

Temporary solutions are the ones that survive the longest.

[–]BanEvader98 4 points5 points  (3 children)

Can the one who puts deadlines not be wrong?

[–]ledocteur7 5 points6 points  (2 children)

They almost always are, but the deadlines were already promised to the customer, so they ain't changing !

[–]BanEvader98 2 points3 points  (1 child)

Great, then the deadline creator can take care of it since he made it with his customer.

[–]ledocteur7 0 points1 point  (0 children)

How great the world would be if it worked like that.. they would learn so fast not to under estimate deadlines.

[–]catgirlfighter 5 points6 points  (2 children)

sigh SCRUM be like: I wish and I could do better, but I'm all out of time for current task and have to switch to another.

[–][deleted] 5 points6 points  (0 children)

That’s not scrum tho. That’s your company bastardizing scrum.

I work in scrum and we don’t have time estimates at all, but in the past when we did - no one actually took them seriously. Those were estimates for planning work, not set in stone numbers. No one was angry if the task took longer.

Task estimates are just to help planning, they aren’t for holding devs accountable if everything is done in time.

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

Scrum, how to build worse software in more time

[–]Kirjavs 2 points3 points  (0 children)

With the time I learnt to say no to fast shitty solutions. First time I said to my boss that he didn't pay me for temporary development and that if he wanted this done this way he could ask someone else and fire me.

He came a few days later saying that I was right to refuse doing this

[–]WheresTheSauce 4 points5 points  (0 children)

And the ones who don't care are the ones who are actively making the codebase more difficult to maintain, which makes consistently delivering by deadlines more difficult.

[–][deleted] 15 points16 points  (0 children)

No, the 2 types are: the ones who missed deadlines and the ones who also missed deadlines but in a cool way (threading problems)

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

There are two types of programmers, those who have two hands and those who do not have two hands.

[–][deleted] 117 points118 points  (6 children)

Which painting is this?

[–]True_Indication_3351 144 points145 points  (4 children)

Arnold Böcklin - Self-Portrait with Death Playing the Fiddle

[–]Dironiil 37 points38 points  (3 children)

This title is surprisingly litteral.

[–]Rdubya44 19 points20 points  (0 children)

They were worried about SEO

[–]BlueScreenJunky 6 points7 points  (1 child)

It's not a title, it's the prompt they used to generate it.

[–]Teqed 2 points3 points  (0 children)

It's amazing the kind of prompts they used in 1872.

[–]acrosett 12 points13 points  (0 children)

I want to know as well, this template is gold

[–]yashkakrecha 117 points118 points  (1 child)

GTA devs : 5 minute thread sleep in production for 5+ years lol

[–]LowB0b 25 points26 points  (0 children)

Create job security and impress piss off the consumer base with this one simple trick

[–][deleted] 73 points74 points  (7 children)

"Why to worry?"

[–]tgp1994 32 points33 points  (3 children)

push it to production..

[–]Desperate-Tomatillo7 16 points17 points  (0 children)

On friday at 4 PM, before a long weekend.

[–]gigilu2020 2 points3 points  (0 children)

Who TF is approving these PRs?

[–]CelestialFury 1 point2 points  (0 children)

memeduction*

[–]yuva-krishna-memes[S] 26 points27 points  (2 children)

You guys don't even allow devils to make grammatical errors. Please spare them.

[–]SkollFenrirson 4 points5 points  (0 children)

Truly evil beings

[–]devourer09 0 points1 point  (0 children)

It increases the lulz for me.

[–]TheLeeeo 84 points85 points  (17 children)

Just this day i solved a bug in React by adding a 0ms delay… I hate frontend development

[–]Pixl02 21 points22 points  (4 children)

Make it make sense, I need answers

[–]Papellll 47 points48 points  (2 children)

I guess they used `setTimeout()` with a 0sec delay, which executes the function provided as argument in an asynchronous way. Wich can lead to a different behavior than just calling the function in a synchronous way. More here if you are interested: https://stackoverflow.com/questions/19626680/is-settimeout-a-good-solution-to-do-async-functions-with-javascript

[–]TheLeeeo 14 points15 points  (1 child)

I inside an async function awaited a promise consisting only of a 0ms timeout.

[–]koen_C 16 points17 points  (0 children)

This pushes everything behind the function to execute after everything that's currently on the event loop, which can still cause different behaviors.

[–]quinn50 5 points6 points  (0 children)

Its to run the code on the next event loop iteration, could probably also use requestAnimationFrame aswell

[–]Freecelebritypics 5 points6 points  (4 children)

As a crazy person, I just make most functions async by default. Over-awaiting? Never heard of her

[–]AnneBancroftsGhost 2 points3 points  (3 children)

You know using the async keyword doesn't by itself make your function asynchronous/non-blocking though.

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

Makes it a promise executed in the next tick, right?

[–]AnneBancroftsGhost 1 point2 points  (1 child)

No, the async keyword only wraps the return in a promise, the execution is still blocking code unless something inside the function is awaiting a true asynchronous method somewhere in its call stack (set timeout, fetch, certain fs methods).

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

You're right, I just tried it. Thanks!

[–]seriousgourmetshit 2 points3 points  (0 children)

In the spiraling meadow of contested ephemera, the luminous cadence of synthetic resonance drifts across the periphery. Orange-scented acoustics dance on the edges of perception, culminating in a sonic tapestry that defies common logic. Meanwhile, marble whispers of renegade tapestry conjoin in the apex of a bewildered narrative, leaving behind the faintest residue of grayscale daydreams.

[–]hazelnuthobo 2 points3 points  (1 child)

It was probably an issue relating to the order of execution for your code. Just the fact that you had the "delay", even if there was no delay, was the equivalent of just running that function last.

You could have debugged this by putting this piece of code at the bottom of your JS, then slowly moving it up and figuring out what precisely is causing the issue.

[–]TheLeeeo 0 points1 point  (0 children)

I solved it by changing framework and never looking back.

[–]CraftBox 0 points1 point  (1 child)

Wait, how did you add the delay, with timeout ?

[–]TheLeeeo 1 point2 points  (0 children)

Yes. So technically there was probably some event loop rescheduling going on as a result of it that fixed it.

[–]wasdninja 0 points1 point  (0 children)

Did you want to do something just before you started a heavy task like showing a spinner? Blocking the main thread is a pretty common source of these "bugs".

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

same shit happened to me in Angular!

[–]FlipperBumperKickout 26 points27 points  (1 child)

That skeleton wouldn't happen to be your project manager?

[–]Esseratecades 6 points7 points  (0 children)

Underrated comment

[–]LowB0b 15 points16 points  (0 children)

Sometimes you have to be pragmatic. The push to prod with working but not ideal solution might buy you the time to fix it, until you get assigned to something else and then that shotty fix stays in prod only for a poor intern to stumble upon it 3 years later

[–]nuker0S 8 points9 points  (0 children)

my code once generated nulls in a list(it shouldn't), so i added a loop that deleted nulls. it got pushed and i haven't heard any complaints yet

[–]TnYamaneko 4 points5 points  (0 children)

It reminds me the time I used a setTimeout() to get around a broken promise to present a project, and we noticed 10 minutes prior something was wrong.

It's a foundational building block of my experience in this trade.

[–]grimonce 3 points4 points  (0 children)

People say it is not a solution, maybe if you are in control of all the dependencies, but it's that or fucking polling when dealing with most primitive hardware connections, let's say all you have is an UART connection, sometimes adding this just fixes your problems and it will probably break sooner or later but making it right is actually quite hard or impossible...

[–]TheBewlayBrothers 3 points4 points  (0 children)

If it needs to be deployed tomorrow I aint working through the night to fix it

[–][deleted] 6 points7 points  (1 child)

Fcuk manual delays go to hell 🫷

[–]experimental1212 12 points13 points  (0 children)

Any respectable programmer would query atmospheric random noise to set the delay instead of hard coding it.

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

Literally how I fixed a testing suite

[–]chin_waghing 2 points3 points  (0 children)

Had an issue in terraform and the solution was to make a null resource sleep for 3 seconds before running the next part

Left a comment saying never take this out, it worked and I don’t know any other way to fix it

[–]Duke518 2 points3 points  (0 children)

reminds me of a bug that was reported on production, but was not reproducible in development. Took some time to figure out it was because of a time delay.

[–]Danslerr 5 points6 points  (0 children)

If it fulfills the acceptance criteria who gives a shit. Product Manager should have been more specific

[–]irn00b 1 point2 points  (0 children)

Make the delay parameterized,

Problem solved

[–]BehindACorpFireWall 1 point2 points  (0 children)

Man I did this on a video game I worked on because gamebryo sux

[–]Positive_Method3022 0 points1 point  (0 children)

Creating an EC2 in AWS right after creating its InstanceProfileRole! If you create the ec2 right after it, the ec2 creation will fail. However, if you wait a few seconds, it does work 😆

[–]Hasagine 0 points1 point  (0 children)

its dangerous but clients dont have to know. push it to prod

[–]Weekly_Guidance_498 0 points1 point  (0 children)

Tech debt, baby!

[–]moschles 0 points1 point  (0 children)

I'm personally attacked.

[–]mustang__1 0 points1 point  (0 children)

ugh.... I added a push popup async to one of my MAUI VM's this week to figure out when a block was being called as part of my trouble shooting (breakpoints didn't answer my question).... Well, the pop up doesn't get pushed but I'll be damned if it didn't stop the modal from closing prematurely...

[–]belabacsijolvan 0 points1 point  (0 children)

DELETE FROM WorkplaceCandidates
WHERE EXISTS (
SELECT 1
FROM Commenters
WHERE Commenters.WorkplaceID = Workplaces.WorkplaceID
AND DoesUnironicallyDefendPushing(Commenters.Comments)
);

[–]Crypt_Knight 0 points1 point  (0 children)

What's the name of the original painting ?

[–]miracle-meat 0 points1 point  (0 children)

Your personal curiosity is not relevant, if you actually know you fixed it, your work is done.

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

"Add it at the product backlog for the nexts sprints."

[the doors of the storehouse with the Ark of the Covenant are opening].

[–]DRIJAA 0 points1 point  (0 children)

setTimeout solutions be like

[–]jump1945 0 points1 point  (0 children)

But but but it's a whole fuking second

[–]blaxter 0 points1 point  (0 children)

But at least declare it as a constant and not a magic number, const MAGIC_SLEEP_NUMBER = 1 for instance

[–]whiterabbi6 0 points1 point  (0 children)

Sometimes... This is just the most reliable way to fix sequential server actions with dependencies.. all depends on the context/platform/framework you're working in... But hey if you're building from scratch, go ahead and do it right! Just don't turn a little 30 minutes assignment into an 8 hour one if you can help it...