Imagine you're getting a new coworker who knows nothing about your codebase, but is otherwise brilliant at programming, although he has horrible social anxiety so he always says yes and never asks clarifying questions, and hallucinate at times, and he also has Alzheimers so he's gonna forget everything you tell him in like 1h. So the less code you give him the better. Comments can help. You have to break it down into small modules instead of writing spaghetti code.