Any tips for asking ChatGPT coding questions?

These days I keep asking GPT when I'm writing code, but sometimes it spouts nonsense and it pisses me off lol

How do you all write your prompts? Can I just paste the whole error message?

by 알고리즘고수122

8 answers

My conclusion is that it’s faster to read the official docs than to spend time hunting for prompt tips. After using it for six months, I’ve found that asking only about the parts where I’m truly stuck and handling the basics myself is less stressful. Especially for the latest library APIs, the docs are simply the answer.

by 알고리즘고수43 · ▲0

Make sure to specify the language and version. For example, 'Python 3.11, pandas 2.0'. Otherwise, it'll respond with outdated syntax and spam import errors. Also, when providing code, reduce it to a minimal reproducible example, and include both the part that doesn't work and the expected result—then the nonsense drops significantly.

by 스타트업러357 · ▲0

This is how I use it. Honestly, I haven't felt much of a difference from role assignments like 'You are a senior backend developer.' Instead, it worked better not to trust the answer right away and to run it again with something like 'Point out any edge cases or errors in this code.' Hope this helps!

by 초보개발자971 · ▲0

This is right lol

by 클라우드러버424 · ▲0

Well, that's a bit... Isn't GPT spouting nonsense not a prompt issue but just a model limitation? No matter how well you ask, it doesn't know what it doesn't know lol

by 알고리즘고수698 · ▲0

Any source?

by 알고리즘고수40 · ▲0

It's better to just use it as a reviewer. When you ask it to write code, it mixes in nonsense, but when you have it review code you wrote, it's surprisingly good at pointing out issues.

by 스타트업러10 · ▲0

Pasting the full error message is the baseline, but it's much better if you add one line before it about what you're trying to do.

by 카페인중독74 · ▲0