DEV Community

Cover image for Stop Asking AI to Write Your Code. Ask It to Explain Like You’re 5.

Stop Asking AI to Write Your Code. Ask It to Explain Like You’re 5.

Let’s be honest. I use AI tools daily. Most of us do 🤷‍♀️.

But there is a massive difference between using AI as a crutch 🩼 and using it as a rocket booster for your brain 🚀.

At first, when I got stuck on a tough concept, I would paste the problem into ChatGPT and ask for the solution. It gave me the working code. I felt productive for about five minutes. ⏱️

But then I realized something scary: if the AI disappeared tomorrow, I wouldn't actually know how to solve the problem myself. I was outsourcing my understanding. 😱

The Feynman Technique Meets AI 🤝

There's a concept called the "Feynman Technique," named after the physicist Richard Feynman. The core idea is simple: You don't truly understand a complex topic until you can explain it in simple terms so that a beginner (or a five-year-old) can grasp it. 🧠

AI is incredibly good at generating complex, technical documentation. But surprisingly, it's even better at generating dead-simple analogies. ✨

Instead of asking AI to do the work for me, I started using it as the world's most patient tutor. 👨‍🏫

The "Aha!" Moment: Python Lists and Zippers 💡🐍
Recently, I was looking at some Python code involving list comprehensions and the zip function. It looked something like this:

def mulTable(n):
    return [n*i for i in range(1,11)]

l1 = mulTable(3) # [3, 6, 9, ...]
l2 = mulTable(6) # [6, 12, 18, ...]

# The confusing part:
s = [x + y for (x,y) in zip(l1, l2)]
Enter fullscreen mode Exit fullscreen mode

If you ask a standard documentation search what's happening in that last line, you get an answer like: "The list comprehension iterates over tuples generated by the zip object, aggregating elements based on their corresponding index." 😵‍💫

Great. Accurate. But it doesn't stick in my brain (especially for slow learners like myself, having to read stuff over and over again to understand it for a brief moment, and forget it the next 2 minutes).

So, I changed my prompt. I asked the AI: "Explain this code to me like I am 5 years old." 🧸

The explanation completely changed how I visualized the data.

The ELI5 Explanation 📖
Instead of "iterating tuples," the AI told me a story about baskets and zippers:

Imagine l1 and l2 are two long baskets full of numbered balls 🧺.

The zip command is like the zipper on a jacket 🧥. It pulls the two baskets together, side-by-side.

It takes the first ball from basket A and the first ball from basket B and squashes them together (adds them up) ➕.

It moves down the line, zipping up the next pair, until it has a brand new basket.

Suddenly, the code wasn't abstract anymore. It was visual. I could "see" the zipper pulling the lists together. 👀🤐

How to make this work for you 🛠️
When you are learning a new framework, language, or algorithm, don't just ask for the "how." Ask for the analogy.

Here are some prompts I use constantly:

"Explain the difference between Docker and Kubernetes using an analogy about shipping containers 🚢."

"Explain recursion like I'm a kindergartener stacking blocks 🧱."

"Don't give me code 🚫. Give me a real-world example of why I would use a Linked List instead of an Array 🔗."

AI isn't going to replace developers who truly understand their craft. But developers who use AI to deepen their understanding will replace those who just use it to copy-paste. 📋

Some people might argue that AI has done more harm than good, but in my perspective, if used properly, AI is the best tutor you can have to teach absolutely anything, if the correct prompts are used!

Top comments (9)

Collapse
 
fralau profile image
Laurent Franceschetti

That's a good way to look at things!

I use AI as an assistant, in the literal sense: I am the boss, and I delegate work to the AI. But I am the one who is in charge of things and responsible in front of myself and others. So I had better know what my assistant is doing, and what reasoning it is following, and make sure that it is following my instructions.

Also, it is smart to learn from one's assistant. If it was hired, it is because it has knowledge and skills. And asking it to explain as if one was a child, is a good way to learn!

In the end, it boils down to curiosity and desire to lean. Many people who misuse AI appear to be lazy, but there is something deeper than that: they are not interested.

Let's consider how lucky we are: there is a machine there, to whom we can ask many questions about many things we don't know, and get answers, so that we can learn things. Furthermore, it is patient and supportive and has unlimited time.

To use that tool to do our thinking for us, would be like having a ton of food in front of us and give it to the birds; instead of eating it ourselves.

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Exactly, using it as an assistant makes us way more productive. Good piece, Laurent😊

Collapse
 
braingrid-ai-inc profile image
BrainGrid AI, Inc

Good!

Collapse
 
art_light profile image
Art light

This is a great mindset shift—using AI as a tutor instead of a shortcut turns confusion into lasting intuition and compounds your learning over time. 😉

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

Exactly, there are two sides to the coin. We just have to use AI to aid us.

Collapse
 
art_light profile image
Art light

Thanks for sharing your idea.😊

Thread Thread
 
maame-codes profile image
Maame Afua A. P. Fordjour

You are welcome! 😊

Collapse
 
devon__kelley profile image
Devon Kelley

This is brilliant. We should all be using AI to enhance our abilities, not to outsource our thinking.

Collapse
 
maame-codes profile image
Maame Afua A. P. Fordjour

You are welcome! 😊

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more