DAILY NEWS

Stay Ahead, Stay Informed – Every Day

Advertisement
How to Debug AI-Generated Code as a Beginner



You generated a feature in thirty seconds using Claude. It compiled. You deployed it. Then something broke in production.

Now you’re staring at an error traceback, and you realize something terrifying: you have no idea what the code actually does.

This is called “vibe coding,” and it’s the defining trap of learning to code in the age of AI. You can generate working code instantly. But when it breaks, you’re completely lost. You can’t debug what you don’t understand.

The instinct is to paste the error into Claude or ChatGPT and run whatever it suggests. That’s the wrong move. It leads to a cycle of patches stacking on patches until your codebase becomes unmaintainable. You need a different approach.

Why Debugging AI Code Is Different

Traditional debugging assumes you wrote the code. You remember what you were trying to do. You understand the control flow. You can trace execution paths in your head.

With AI-generated code, none of that is true. You’re reading code as if someone else wrote it. You lack the mental model of why it exists. You don’t understand the architectural choices.

This creates what researchers call “debugging by guessing.” Your code fails. You see an error message. You immediately paste the error into an LLM and run the suggested patch. Sometimes it works. Often it introduces new failures elsewhere.

The problem is that LLMs optimize for local fixes, not global understanding. They patch the symptom without addressing the cause. Over several iterations, your code accumulates redundant checks, swallowed exceptions, and tangled logic that only gets worse.

The cost shows up later. When a system needs modification. When a subtle bug appears. When you need to add a new feature that interacts with existing code. At that point, you hit a wall. The final 10% of the work—the parts that require understanding—becomes impossible.

The Wrong Way: Debugging by Copy-Paste

The moment your AI-generated code fails, the temptation is immediate. Copy the error. Paste it into Claude. Run the fix.

Resist this.

This workflow trains your brain to avoid productive struggle—the cognitive friction of sitting with a problem and working through it. When you skip it, you short-circuit learning.

Research from an Anthropic study shows developers using AI to generate code score 17% lower on comprehension tests than those who write code manually. They feel productive. They’re shipping features. But they’re building a codebase they can’t maintain.

The Right Way: Use AI as a Dialogue Partner

Flip the dynamic. Stop asking AI to fix your code. Start asking it to help you understand why the code is failing.

This is called Socratic debugging. Instead of pasting errors and accepting solutions, you use AI as a thinking partner that challenges you to diagnose the problem yourself.

Here’s how it works in practice. Your code fails. Instead of pasting the error, you write a precise prompt: “I’m getting this error. Don’t write any code. Instead, ask me clarifying questions to help me locate the bug myself.”

The AI now becomes a tutor. It asks you questions about what the code is supposed to do. It walks you through your mental model. It helps you narrow down where the failure might be. You’re doing the thinking. The AI is scaffolding your reasoning.

Another powerful approach: ask the AI to describe what the code does before you try to debug it. “Read this generated block of code and describe its execution path in plain English. Do not write any code.” This forces the AI to articulate the logic, which often exposes what’s actually happening versus what you thought was happening.

Or ask it to identify edge cases: “Identify potential edge cases and failure modes that could break this function. Do not write code.” This trains your brain to think defensively about code instead of assuming it works.

The key is constraining the AI from writing code. When you do, it becomes a thinking tool instead of a code generator.

Set Clear Boundaries in Your Codebase

Before you ask AI to generate anything, establish structure.

Break complex features into small, isolated modules with explicit files and hard folder boundaries. Once these boundaries exist, freeze your interfaces by writing contract tests that pin inputs and outputs. Then instruct the AI: “Work only in this file. Do not modify other files. Do not create new helper functions.”

This prevents the AI from generating duplicate code across multiple files. It prevents breaking changes in one area from silently failing elsewhere. It gives you architectural control.

This practice is called componentized thinking, and it’s essential for keeping AI-generated code maintainable.

Manage Your Chat Context Carefully

As a conversation with an LLM grows, the model’s token context window gets saturated. The model compresses earlier messages. It forgets folder structures. It renames variables. It hallucinates functions that were never written.

At this point, continuing the same conversation becomes counterproductive. Start a fresh chat instead.

Before you do, have the AI document the current progress in a markdown file. Write down what works, what’s unresolved, what you’ve tried. Then paste that summary into a new, clean session.

Better yet, maintain systematic documentation in your repository itself. Create a file called vision.md that describes the core features and user flow. Create a ConnectionGuide.txt that logs every port, database URI, and API endpoint. When you start a new chat, point the AI to these files instead of re-explaining everything.

Couple AI Guidance with Real Debugging Tools

Here’s the hard truth: AI can guide your thinking, but it can’t see your running code.

LLMs analyze static code. They can’t observe the live state of a program. When debugging runtime failures, they’re working from incomplete information. You need real tools to see what’s happening.

If you’re using Python, tools like Python Tutor or Thonny let you step through code line by line, watching variables update and the call stack unfold. Seeing the execution path visually is far more revealing than reading code.

For system-level issues, run diagnostics directly. If a file sync is stalled, use lsof to check file descriptor locks. Use ps to check active processes. Use netstat to see network connections. Have the AI suggest a diagnostic plan, then execute the commands yourself and verify the results.

This combination—AI for strategic guidance, real tools for tactical evidence—is far more powerful than either alone.

The Accountability Principle

Research on student learning reveals something striking. When students know they have to explain their code to another person, they study differently.

A study of university CS courses found that students with unrestricted AI access performed better when required to defend their code in oral interviews. Why? Because the upcoming defense forced them to actually understand what they generated. They studied their code. They tested it. They prepared explanations.

This accountability mechanism is powerful. You don’t need an actual person. You can create this for yourself. Before committing code, write a brief explanation: What does this do? Why does it solve the problem? What could break? If you can’t answer these clearly, you haven’t understood it well enough.

This discipline forces you to engage with your code rather than skating past it.

The Honest Path Forward

AI is genuinely useful for debugging. It can suggest diagnostic approaches. It can explain why something might fail. It can generate test cases to verify fixes.

But the developers who thrive are those who treat it as a thinking partner. They establish boundaries in their codebase. They manage their context windows. They use real debugging tools alongside AI guidance. They hold themselves accountable for understanding their code.

Platforms like Mimo structure learning around this exact principle. Rather than letting you generate entire applications, the curriculum emphasizes interactive debugging and understanding. You write code manually. You debug it manually. Then you learn where AI fits into that foundation.

This approach takes more time than copy-pasting fixes. It’s also the only approach that actually builds competence. Your goal isn’t to ship code as fast as possible, but to become a developer who understands systems, debugs problems systematically, and maintains code that lasts.



Source link

The Journey Begins: Week 1 as an Aspiring Data Professional.


Introduction

‎Ladies and gentlemen, I believe in this era of social media, we have all come across content that encourages us to ‘Awaken the beast within’. Up until a week ago, I thought that it is only us humans that contained a beast that needed awakening. Shock on me when I discovered that machines too, specifically computers/laptops, harbor a beast of their own: Microsoft Excel.

For those already familiar with Excel, you already know what I am talking about. If you happen to fall under this category, a newbie alert is hereby issued: you may relax, take a back seat, and sip your juice. For the rest of the newbies like myself, buckle up your Excel belt and get ready to explore.‎‎

Excel and its use cases.

‎Picture yourself as a local food chain supplier with all kind of assorted food items stored in a certain warehouse. The catch? Your stock is scattered everywhere. The moment you step inside the warehouse, an overwhelming sense of confusion weighs down on you. To get on top of things and excel (pun very much intended), you would definitely have to hire some people to come and do the arrangement and sorting of the food items in a manner that restores order.

‎Excel is the equivalent of the people you hire to bring order into our imaginary warehouse. It is basically a tool that helps you interact with numerical data in a more meaningful and impactful way. Excel helps you in data management, offering a wide range of functionalities at your disposal, ranging from collecting, organizing and analyzing of data, to calculation and effective visualization. Is data your problem? Excel is your solution.

‎Are you a small business owner wanting to keep track of your stock, sales and calculate profits? Call Excel. Are you a large financial institution looking towards managing your income statement and gain insights on your revenue growth? Call Excel. Are you a medical institution and want to make sense of your patient records? Call Excel. Are you in the hospitality industry and need to learn your client trends so that you can offer better services? Call Excel. Is your home being robbed? You’d better call 911 as Excel won’t be coming to your rescue.‎

‎‎Excel Features and Formulas.

‎The past one week has been one full of new discoveries in Excel. Let me paint you a picture.

‎Assume that I am the class teacher of Form 4 West at Excellent High School. Students have just completed their exams and the results are out. Before working on the data, I would first ensure that it clean by ensuring correct formats are followed. For example, in the name column, I would use the PROPER function to ensure the student names are in the correct format. I would then check for duplicates in the data and remove them if they exist.

‎Once done with the cleaning l, would then dive deep into analysis, starting off by average performance of the class. This would be achieved by the AVERAGE function in the column ‘Overall grade” by typing =AVERAGE (range). To identify the top-performing student, the MAX function does the job: =MAX (range). Conversely the MIN function to know the worst performing student. By now I believe you have are starting to get the hang of it.

Beyond these basics, Excel also offers powerful tools like IF statements for flagging conditions (for example, automatically marking students who scored below 50 as “At Risk”). Each formula unlocks a new layer of what the data is trying to tell you.‎‎

Conclusion

‎My first week of learning Excel has left me excited and eager, like a kid in a candy store. It is often said that numbers never lie and that they do tell a story. Left to their own devices, numbers remain just that: numbers, and so does data. Excel is what transforms raw data into stories, and for every story told, there is impact made.

Let’s go and Excel!‎



Source link

Fraudulent Development



“Hey Claude, how do I do x?”, is how I began each coding session. What’s so wrong with asking AI for help? Was the biggest question I had when I started learning to code. I had a myriad of excuses justifying my use of it; I can iterate faster, know more and have access to the entire internet. Unfortunately, AI can’t actually make you a developer, or a better one.

Okay, but why bring up ethics?

Great question! I’m glad you (I) brought it up! To preface this, I am simply an individual who has seen the downsides of unethical actions and behaviors, especially my own unethical actions and behaviors.

Not unlike many out there (maybe even you), I began my journey to becoming a developer with great excitement and a deep desire to create some pretty dope apps. “Hey Claude, how do I make a static webpage?” Literally the first prompt I made. Not so unethical. Essentially a Google search with extra steps. Now let’s look at the next prompt.

“Hey Claude, I want to make a terminal based dev tool that helps developers warm up in the mornings, can you help me with that?” Even that doesn’t feel entirely unethical. Probably lazy, but not unethical. This next prompt right here, this is the one that made me realize my folly: “I feel over my head, can you just finish this project and make sure to follow Node.js best practices for security”… There it is, this is what I am referring to when I say “unethical”. I gave up, and made AI finish my project, shipped it as my own creation and then sat there like a chump hoping no one would find me out as the fraud that I am.

But Ffyrn, how is that unethical? I lied about the project, I wrote blog posts and social media posts about this amazing new tool that I alone had created. It even got a little over 400 downloads from NPM. Gross, I know. I could give excuses like, well I see other new devs doing this too, or even, AI is the forefront of dev tech and I need to be ready for it. But those have as much logic to them as a puddle of water on the sun (none). I’m not trying to damn anyone for actively using AI, up until now I have had a pretty “anti-ai” vibe in this post. But I do think it can be useful, just under the right conditions. Not how I was using it.

Iterating at the speed of ignorance

“But it helps me iterate faster!!” Okay…so what? Did I miss the beginning of some race? When did speed equate capability? When did speed make a person a better developer? It doesn’t. I got so trapped in the “iterate fast” lifestyle before I even knew how to print a “Hello, World” statement to the terminal, that I missed the entire point of writing code. Which is to have fun and build awesome tools that enrich other peoples lives.

Solving a problem isn’t about how fast you can solve it, or if you use “the best” tools to solve it. What matters is that you understand the problem AND the solution in its entirety. Several times I have prompted AI to give me a wireframe or MVP for an app idea, just to see what it poops out for me. It’s rarely anything actually good or useful. I generally receive a poor retelling of what someone on Reddit said six years ago.

Iterating fast doesn’t matter in my opinion, but if you truly want to iterate fast, go to YouTube, watch a tutorial video, be the post on Reddit that AI scrapes, or even better; read a book! There is a legion of books out there, probably one for the very problem you are facing right now (I just started The Deeper Love of Go by John Arundel!)

The entire internet at your fingertips (like it wasn’t already there…)

We could do a quick google search, and it will yield more accurate answers every time instead of asking AI. Simple right? Maybe too simple. Somehow, I convinced myself I had to use the same tools as other devs, or I’m not a real/successful dev. But for every dev who chooses to use AI as google, there are more who bear the burden of inquisitiveness, refusing to accept AI slop.

I treated AI like it was my own personal access point to the internet. Ask a question and get an answer. Need syntax? AI. Ew, I understand. But as they said in Monty Python, “I got better.” Now, I just google it, or better yet, I go to a Subreddit for my questions (Stack Overflow is absolutely still a viable option, it just seems not as active as in the past).

Good for you, Ffyrn. You learned what every developer learns in CS101. Except not every developer takes CS101, or even CS50 (it’s free on YouTube!!) Most of us get a desire to solve a problem, learn that writing code isn’t just for the Torvalds of the world, and get excited. Raise your hand if this feels like you (okay quickly put it down before someone sees you randomly raising your hand, weirdo).

The big finale

You’ve made it this far? I’m honored! Why does all of this make me a fraud? Is AI bad to use? Can you get better (I did.) The latter two are for you to decide. As for the former, I said I was something I was not. I gallivanted around like I was a developer, when in reality I was simply a poor prompt enthusiast. I can absolutely understand being afraid that people won’t respect you because you are new, which is fair. Respect is earned in this industry, trust is the baseline, and you cannot have either when someone will just copypasta an AI response.

Furthermore, I write this to out myself for my past fraudulence and to give transparency on how I view this topic. Too often I scroll through dev.to or Hacker News and see nothing but articles and posts about how “AI makes you a better developer”, or the latest and greatest AI tool. When I really want to be seeing people building things without the handicap of AI, people challenging themselves and failing. I want to see what I have been told are the day’s of yesteryear. Devs working with each other to make cool shit. Not devs trying to get to the finish line first. And I could absolutely be looking in the wrong places for these things, if so, I apologize for my griping. Please show me where I can find these things, I will be eternally grateful!



Source link