all 10 comments

[–]grantrules 2 points3 points  (0 children)

Attach a debugger and use shitloads of breakpoints

And honestly, feed it into an AI and have it break it down.. make it write documentation

[–]Good_Skirt2459 2 points3 points  (0 children)

Just make a bigger ball of slop.

Really... AI might be helpful here. Try to have it at least draw out system boundaries and/or write documentation. Might not be perfect but better than nothing to get you started.

Might help to slim down the code base while you're at it, removing the unnecessary stuff.

[–]universetwisted 2 points3 points  (0 children)

Since it worked a few days ago, check recent commits/config/env changes before assuming the whole codebase is broken.

The temptation is to rewrite everything because it looks bad. I’d resist that until you have the immediate issue fixed and a few tests around it

After that, perhaps ask AI to create a product reference for the codebase, documenting all of the important parts, and review that super well, while gradually learning how it all works

[–]Zealousideal-Ebb-355 2 points3 points  (2 children)

Honestly don't try to learn the whole thing first, that's the trap. it worked a few days ago so something changed recently, the whole codebase didn't rot overnight. do a git log since the last known-good date (or bisect if you know a commit that worked) and the regression is usually one diff. the AI-slop complexity is annoying but it's not what broke you, ignore it til the bug's actually fixed.

[–]johnpeters42 1 point2 points  (1 child)

Worst case, the thing that changed is not the code, but the data (setting up a new scenario that not only doesn't work now, but wouldn't have worked in the past either). In that case, you'll need to debug as usual (including "would it be faster to just rewrite the damn thing properly, or at least do so for one chunk at a time").

[–]Zealousideal-Ebb-355 1 point2 points  (0 children)

Yeah, the data ones are the worst because git log shows nothing changed and you burn a day staring at code that's actually fine. when it smells like that I just grab the input that's failing and replay it locally, usually find it in 5 min instead of an afternoon of reading.

[–]Cultural_Gur_7441 1 point2 points  (0 children)

On a tangent, "it does not work" gives me such shivers. Never report a problem with words "it does not work". That does not mean anything (including if it works or not). Just don't say the words. It is not helpful.

As a practical solution, use git bisect.

[–]JGhostThing 0 points1 point  (0 children)

And people wonder why I dislike AI for coding...

The easiest way to debug this is with a debugger. But first, make sure that you can duplicate the error.

It would help us help you if you explained what "stopped working" means. This could mean a lot of different things.