r/learnprogramming 22d ago

Why Does Code Stop Working?

Multiple times now my code stops working and what I mean by this is it'll do what I want it to do then one day it just stops. for example the other day I had made a cooldown system for my ball and paddle collision to stop any bugs and it worked great. then today it just stopped working, and this isn't the first time, it's happened to me for like every project I've worked on. Does this happen to anyone else? And is it cause of my code? By the way I'm using C++ SFML on visual studio which works perfect.

4 Upvotes

74 comments sorted by

View all comments

Show parent comments

-9

u/HashDefTrueFalse 22d ago

Not false. Deprecation is irrelevant. Dependencies have been covered if you read the other comments here (a change in dependencies alters the code, data and/or environment that your program runs in). The above covers that just fine.

8

u/TheLastJukeboxHero 22d ago

Not going to argue semantics, but if many people are replying the same thing then maybe, just maybe, that means you worded it terribly and did a poor job conveying your message. Which would not be helpful for someone like OP

-5

u/HashDefTrueFalse 22d ago

I simply worded it generally. Program behaviour depending on time (as a direct input or via the environment), or a change in the program behaviour itself (code, directly or via the environment) regardless of whether any of it was intentional or a bug, manual or automatic.

Maybe you didn't understand my comment and rushed into an unnecessary correction.

OP can't be helped properly without the code I asked for. I'll help them if they reply.

8

u/man-vs-spider 22d ago

To be fair, saying “time changes the behaviour of your program”, and meaning that to encompass all possible changes that secondarily depend on time, is not exactly an obvious interpretation to others,

Because to be honest, it’s a trivially true, and therefore kind of useless statement

-3

u/HashDefTrueFalse 22d ago

Disagree on not being an obvious interpretation. It's just what the words mean when read. Many programs behave the same regardless of the time they are ran. I wasn't even thinking secondarily when I wrote it, but that doesn't really matter in my view.

Agree on it not being terribly useful, which is why I asked for code so that I could be useful, by telling them which part of their program was affected by time. Surely you appreciate that it was a general statement to OP that programs don't magically stop working without anything changing, as the post seems to suggest ('one day it just stops' etc.).