Rubberducking with ChatGPT

jasonleow  •  12 Apr 2023   •    
Screenshot

Today I solved a number of Javascript issues I face using ChatGPT. I must say I’m impressed. Previously I asked code questions for Vue.js, but perhaps the training data is limited or the way I asked, it kept giving me answers that were clearly wrong. This time it somehow shined through.

My lessons on how best to collaborate with ChatGPT on coding questions:

  • Provide context, show parts of datasets, define variables and constants if needed, share what errors you faced.
  • The more code and datasets you show the more relevant the answer.
  • Ask in stages, not all in one go. Break it down so that it can also build up context.
  • Tell ChatGPT it was wrong, what were the errors that came from the code it provided.
  • Iterate on your questions, rephrase in a different way.

Given enough context, ChatGPT can provide code that customised to your code. That’s a clear step up from asking questions on Stack Overflow, because I often have to adapt and re-jig the answers I find there. With ChatGPT, I get the right code, and it can also explain it line by line what the code does.

I’ve seen folks use ChatGPT for writing template code and all. But I was never impressed with that (you can download or copy paste template code easily). But this is different. I can imagine, especially for beginners, ChatGPT or equivalent, paired with good old Google search, might be really useful as a coding assistant and coach.

One of the use cases for AI that I’m enthusiastic about.

Comments

Based on context, I’m going to lump “rubberducking” and “dogfooding” in the same euphemistic category.

therealbrandonwilson  •  12 Apr 2023, 4:13 pm

Haha gotta love those animal euphemisms 🐤🐶 though rubberducking is more for developers while dogfooding is for startups

jasonleow  •  13 Apr 2023, 1:41 am

Discover more

Sourced from other writers across Lifelog

Ooops we couldn't find any related post...