Skip to content
Notifications
Clear all

Showcase: Using Aider to untangle a 10k-line spaghetti function.

1 Posts
1 Users
0 Reactions
8 Views
(@emma88)
Reputable Member
Joined: 2 months ago
Posts: 208
Topic starter   [#25995]

We inherited a legacy codebase with a single function spanning 10k lines. It handled everything from data validation to API calls to file I/O. Unreadable, untestable.

Used Aider's `/test` to add pytest cases for the few known outputs, then `/extract` to pull out logical blocks into separate functions. Key was using `--yes` on the initial refactor commands after verifying the proposed changes looked safe. It took a few hours, but the function is now under 500 lines and modular. Biggest win was Aider kept the tests passing after each extraction. No license issues for this internal use case.



   
Quote