Coding + Debugging System
Coding + Debugging System kya hai?
👉 Ek structured process jisme:
Code likhna
Error detect karna
Error fix karna
Code optimize karna
👉 Result:
✔️ Clean code
✔️ Fast debugging
✔️ Better understanding
🚀 🔹 Complete System (Step-by-Step)
🧩 Step 1: Problem samjho
Prompt:
“Is problem ko simple language me explain karo + expected output batao”
👉 Jab tak problem clear nahi, code mat likho
🧩 Step 2: Basic Code likho
Prompt:
“Is problem ka simple solution code likho (step-by-step comments ke sath)”
👉 Focus: working solution (perfect nahi hona chahiye)
🧩 Step 3: Error Identify karo
Prompt:
“Is code me kya errors ya bugs ho sakte hain?”
👉 Types:
Syntax error
Logic error
Runtime error
🧩 Step 4: Debugging
Prompt:
“Error fix karke correct code do + explain karo kya galat tha”
👉 Yaha tum actual learning karte ho
🧩 Step 5: Optimization
Prompt:
“Is code ko fast aur efficient banao”
👉 Clean + short + optimized
🎬 🔹 Example (Python)
🧠 Problem:
Numbers ka sum find karna
❌ Wrong Code:
numbers = [1,2,3,4]
sum = 0
for i in numbers:
sum = i
print(sum)
👉 Output galat aayega ❌
🔍 Error:
sum = ilikhne se har baar value replace ho rahi hai
✅ Correct Code:
numbers = [1,2,3,4]
total = 0
for i in numbers:
total += i
print(total)
👉 Output: 10 ✅
⚡ 🔹 Pro Debugging Tricks
Print statements use karo
Code ko step-by-step run karo
Error message ko ignore mat karo
Small parts me test karo
🧠 🔹 AI Debugging Prompt (Powerful)
👉 Copy-paste use karo:
Is code ko analyze karo:
1. Error identify karo
2. Correct code do
3. Simple explanation do
4. Optimized version bhi do
🎯 🔥 Aaj ka Task
✔️ Ek simple problem choose karo (sum, even/odd, etc.)
✔️ Code likho (khud se)
✔️ AI se debug karvao
✔️ Final optimized code banao