L
1

I got my AI to write better code by asking it to 'think out loud' first

I was working on a Python script last week and my usual prompts kept giving me buggy results. After three tries, I changed my approach and typed 'Explain your reasoning step by step before writing the code.' The AI then wrote a short plan and the final script worked perfectly on the first run. It added maybe 30 seconds to the process but saved me an hour of debugging. I've used this trick for a few days now and it's made a huge difference. Has anyone else tried getting an AI to show its work like this?
2 comments

Log in to join the discussion

Log In
2 Comments
kimc86
kimc867d ago
Hey, that's so true! It's like when you have to explain a problem to someone else and the answer just pops into your head halfway through. Forcing the AI to slow down and plan makes all the difference.
2
ivan_schmidt
Read a study that called it the "rubber duck" method for debugging.
4