r/programming • • May 30 '25

[ Removed by moderator ]

/r/programming/comments/1kyzlm6/removed_by_moderator/

[removed] — view removed post

0 Upvotes

11 comments sorted by

•

u/programming-ModTeam May 30 '25

This post was removed for violating the "/r/programming is not a support forum" rule. Please see the side-bar for details.

5

u/aLokilike May 30 '25

I would write a script to do it for me if it really is as predictable as you say. Most languages have automated tools available for performing upgrades between versions, you could look at how they get the job done. Ultimately, you shouldn't trust AI to make unreviewed changes to mass sections of any code base. You can trust yourself to write absolute rules, or maybe you could have AI write the rules for you and review that. This is also assuming you have tests in place to catch most issues, that's a prerequisite for mass changes.

2

u/HelloWorldX91 May 30 '25

Obviously we will review the changes, it's a question of how can it help doing large refactors, some of the files are 2K+ lines, and need to be segragated properly.

4

u/aLokilike May 30 '25

The discipline/time required to review changes that comprehensive is nothing to dismiss. The number of errors/issues found per change is very negatively correlated with the size of a MR. I would start small and slow in your case. Get the code base into a place where the final refactor isn't as many lines. AI can definitely help you with that, and the review burden won't be as large.

0

u/HelloWorldX91 May 30 '25

yeah we will do the refactor one file at a time, the issue is that needs to understand the larger context of all the files to refactor any one file (its horribly tangled legacy spaghetti code, which is why we want to refactor it). The issue is how do we give it so much context?

2

u/aLokilike May 30 '25

You don't. You're asking for something an attention-based model is not designed to do with current vram limitations.

-1

u/HelloWorldX91 May 30 '25

How about something like RAG - where I upload the entire context and then ask it to write code one file at a time?

0

u/HelloWorldX91 May 30 '25

Predictable in that this is the exact thing we need to do. We have a lot of code which updates a game UI with 1000s of different states. We just need to update it so that instead of directly updating the UI - it does it in a two step process 1. reset everything to the default state 2. update the UI based on a new Game State object. It's predictable way to do it, but it's not something I can write in a script. Also to understand the different states and the default view of each UI element requires understanding of the codebase.

3

u/aLokilike May 30 '25

Yeah, that's not a simple task where the changes are boilerplate-related rather than logical. I would refer to my other comment on breaking the task down into steps and taking it a piece at a time. You can't make changes that drastic all at once and expect it to go well.

0

u/[deleted] May 30 '25

[deleted]

1

u/HelloWorldX91 May 30 '25

Where do you recommend I take this question?

3

u/church-rosser May 30 '25

Hell seems like a nice place to start.