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?
3 comments
Log in to join the discussion
Log In3 Comments
kimc864mo 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
jessel352mo ago
Ever tried making the AI literally explain its reasoning back to you before it gives the final answer? I've been doing that with coding problems and it's wild how often it catches its own mistakes mid-explanation. Like the rubber duck thing but the duck actually talks back. Does it work as well for you with non-technical stuff? Curious if the method holds up for, say, writing a difficult email or picking apart someone's logic in an argument.
6
ivan_schmidt4mo ago
Read a study that called it the "rubber duck" method for debugging.
4