I'm currently collaborating on a React project with another developer, and I'm noticing they're making rapid progress but their code files are unusually large and structurally poor. There are issues like improper component separation and an excessive number of useState hooks, which makes me suspicious that they might be using AI to generate their code. Is there a way to find out if any parts of our codebase have been produced by AI? Additionally, what should I consider doing next? Should I enforce stricter coding standards or even request that they refrain from using AI altogether? I'd love to hear your insights on this!
4 Answers
There are currently no reliable tools that can accurately detect AI-generated code. At one point, there was a tool, but it was so unreliable that OpenAI themselves recommended against using it. If you're worried about your teammate's coding style, it might just be that they’re inexperienced with React rather than using AI. AI tends to write cleaner code than what you're describing; excessive use of useState hooks usually points to something else.
Honestly, as long as there aren’t any major issues like security concerns, I don't see why you should ban AI usage. Focus on the coding standards instead. They can incorporate those standards into their AI prompts or fix things afterward. If AI is saving them time, they should also take a bit of time to clean it up afterwards. But yeah, copy-pasting big chunks of AI code isn't the way to go.
What’s the deal with blaming AI for code issues? Instead of focusing on whether the code was AI-generated, prioritize implementing proper code reviews to address the problems you’ve encountered. It's more constructive!
One solution is to just ask your teammate to do some pair programming with you. Watching them code in real-time can give you a clearer picture of their process. Remember, enforcing coding standards is always a good practice. If their AI-generated code meets those standards, then you shouldn’t worry too much—it’s just a tool like any other, such as autocomplete.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically