Lesson 861 of 1169
Asking AI to Suggest Ways to Improve Your Code
Once your code works, AI can spot ways to make it cleaner, faster, or safer.
Explorers · AI-Assisted Coding · ~3 min read
The big idea
Even when code works, it can usually be better. Cleaner. Faster. Safer. AI is great at reviewing your code and suggesting improvements — just like a friendly coach.
Some examples
- 'Can this be shorter?'
- 'Is there a clearer way to write this?'
- 'Is anything risky here?'
- 'What did I forget?'
Try it!
Write or draw something. Ask a friend or grown-up: 'How could I make this clearer?' That's code review for everyday stuff.
Code that works isn't the finish line — it's the starting line
When you build something in Scratch or Python and it finally works, you probably feel like celebrating — and you should! 🎉 But here's a secret professional coders know: 'working' is not the same as 'good.' Code can work AND still be messy, slow, risky, or hard for others to read. That's where AI feedback comes in. Once your code works, paste it into AI and ask 'what could be improved?' You might be surprised what AI notices. Maybe there's a shorter way to do what you did. Maybe a variable name is confusing. Maybe there's a situation your code doesn't handle (like what happens if someone types a letter instead of a number?). The best way to ask is to be specific. Instead of 'make this better,' try 'what three things could I improve here?' or 'is there a shorter way to write this?' or 'what happens if someone gives unexpected input?' Specific questions get useful, actionable answers. Here's the important part: you don't have to accept every suggestion! Read what AI says, understand WHY it's suggesting the change, and decide if you agree. Sometimes AI is right. Sometimes your original way is fine. Learning to judge feedback — from AI or from a human — is a real-world skill that makes you a stronger coder every single day.
- Working code is great — but it can almost always get better 🚀
- Ask specific questions: 'What three things could I improve?'
- Ask: 'What happens with unexpected inputs?'
- You decide which feedback to accept — not every suggestion is right
- Getting feedback is a habit great coders build from the start
Key terms in this lesson
Key terms in this lesson
End-of-lesson quiz
Check what stuck
8 questions · Score saves to your progress.
Lesson help
Questions are best handled with a grown-up here.
For this age range, Tendril keeps freeform AI chat paused until parent/guardian consent and child-safe moderation are fully verified. Use the quiz, notes, and related lessons below, or ask a parent, guardian, teacher, or librarian to work through the question with you.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Explorers · 5 min
AI Helping You Code: What Even Is That?
AI can help write computer code. You type what you want, AI writes the code. Here is what that looks like and why it is so cool.
Explorers · 5 min
AI Coders Make Mistakes Too: How to Spot Them
Just like AI can give wrong answers, AI can write buggy code. Here is what to watch for.
Explorers · 6 min
Make a Tiny Game With AI in 30 Minutes
AI can help you build a small game even if you have never coded before. Here is how to start with a simple project.
