What is the best AI...
 
Notifications
Clear all

What is the best AI for writing complex Python code?

3 Posts
5 Users
0 Reactions
28 Views
0
Topic starter

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?


12

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:

  • You might want to consider breaking scripts into smaller modules instead of one giant file.
  • Make sure to use the Projects feature in the Anthropic Claude 3.5 Sonnet paid plan. It lets you upload your file structure so it stays on track.
  • Be careful with the context window; even the best AI can lose the thread if you dump too much data. Its definitely worth the subscription. Let me know if you need help with the hardware store logic!


10

Cursor is better for nested logic:

  • Cursor AI Code Editor Pro indexes your whole project.
  • GitHub Copilot Individual is fast but misses context. Wont work well if logic is tangled tho.


2

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.


Share: