3 ms·
> I dug into the code and it was thousands of lines of absolute madness Ask the AI to assess the code itself and to propose ways to gradually refactor it for b
by zozbot234 8mo ago
> I dug into the code and it was thousands of lines of absolute madness
Ask the AI to assess the code itself and to propose ways to gradually refactor it for better cleanliness. It can be good at that stuff, but you need to make it an explicit goal.
- sarchertech 8mo agoYeah I tried that but without tests it couldn’t keep the look and feel the same. And spending time thinking deeply enough about it to understand and specify what exactly I don’t want it to change just goes back to my point that coding isn’t the hard part.
- Majromax 8mo agoPrompting all the way down? Have the AI create tests that document existing, known-good behaviours, then refactor while ensuring those tests pass.
- sarchertech 8mo agoThat doesn’t work because tests for Luke and feel are difficult at best and nearly impossible when the code wasn’t designed for it. It’s a chicken and egg problem that you need to refactor to be able to test things reasonably. It’s not an impossible problem to solve. I could probably setup a test harness that uses the existing game as an oracle that checks to see if the same sequence of inputs produces the same outputs. But by the time one done all, got it to clean up the code, and then diagnosed and fixed the issue, I doubt I would have saved very much time at all if any.
- gambiting 8mo ago"feed me even more coins and I'll make my code not suck the second time around, pinky promise" vibe.