Ive been trying to automate this messy inventory system for my uncles hardware store here in Seattle and the python scripts are getting pretty huge. Ive been looking around and people keep saying Claude 3.5 Sonnet is the king for coding now because it follows logic better but then I see others swearing by GPT-4o for its speed and better ecosystem.
Im worried about the AI just hallucinating libraries or losing track of the file structure when things get complex. I have about 50 bucks to spend on a subscription this month so I really only want to pick one. Which one is actually better for handling deep nested logic and classes without breaking?
Honestly, if you're dealing with deep nested logic for an inventory system, I would suggest going with Anthropic Claude 3.5 Sonnet. Ive used both for huge projects and Claude is way less likely to get lazy or hallucinate weird syntax when the file gets long. OpenAI GPT-4o is fast, but it tends to trim code blocks which is super annoying for keeping classes consistent. A few things to be careful about:
Cursor is better for nested logic:
Just found this thread and honestly, I'm in the exact same boat with a legacy inventory system I'm trying to patch up. It's exhausting. My biggest piece of advice is to watch out for context drift once your classes get nested. These AIs look smart until they start hallucinating methods that dont exist because the file got too long for them to track. I've wasted so much time and money fixing refactors that actually broke my logic because I let the script get too messy... it'll cost you more in debugging time than the subscription is worth. Be careful about just blindly trusting the output when youre working on deep logic, it kinda sucks when it happens. TL;DR: Keep your files small and your functions isolated or you'll burn your budget on garbage code that doesn't actually run.