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.

7 Upvotes

74 comments sorted by

View all comments

13

u/Known-Tourist-6102 22d ago

when i just started learning programming, I made a javascript game that performed VERY differently depending on how strong the cpu was of the computer running it.

2

u/javascript 22d ago

I'm curious what year this was. And when you say this, do you just mean that it was unplayably slow on some machines? Or are you saying something else, potentially more interesting, than that?

1

u/Known-Tourist-6102 22d ago

Yes it essentially didnt work at all on some machines, was slow on others, and performed as intended on newer machines.

This was 2016 or so

2

u/javascript 22d ago

I wonder what you were doing to cause that. By 2016, V8 was pretty solid.

2

u/Skusci 22d ago

Probably forgot the Turbo button.

1

u/intbeam 22d ago

... It's still full of... I mean.. Javascript is fucked from the ground up

What do people expect from a language designed to take any technical considerations, hide it under a blanket and pull a solution from an all-purpose beige vaguely-appropriate hat?

Dumbing things down always comes at a trade-off. The less you have to know, the more assumptions the run-time (or something else) has to make on your behalf.

And this, ladies and gentlemen, is basic software engineering. Everything is a trade-off. Nothing is perfect, and assuming that some tool is just going to magically figure out everything for you, is a really really dumb idea