Learning to Think in an AI World: 5 Lessons for Novice Programmers

This is the second article of the series How to Learn to Code in an AI World. Don’t miss the first, Is it Still Worth Learning to Code? Imagine the following scenario: A student is enrolled in an introductory computer science course. They have no previous programming experience and don’t consider themselves very good at […]

May 12, 2025 - 16:31
 0
Learning to Think in an AI World: 5 Lessons for Novice Programmers

This is the second article of the series How to Learn to Code in an AI World. Don’t miss the first, Is it Still Worth Learning to Code?

Imagine the following scenario:

A student is enrolled in an introductory computer science course. They have no previous programming experience and don’t consider themselves very good at math or technical subjects. In this course, the teacher allows the use of large language models like ChatGPT and AI code completion software to help students with their work.

When completing a homework assignment, the student carefully reads the prompt and begins to code. Almost immediately, an AI code suggestion tool generates a long function, which overwhelms them, prompting them to turn to ChatGPT instead. Believing it’s best to use AI as a tutor rather than an answer machine, they request step-by-step guidance. However, after reading the first point of advice, they scroll past the explanation in search of a quicker solution and copy the generated code. This code, however, does not fully match the problem and contains unfamiliar syntax, leading to confusion. After repeatedly passing their code back and forth between the IDE and ChatGPT, they eventually produce a version that passes the test cases, though without fully understanding how it works.

When asked later about how useful they found the AI, they answered “very” and appreciated its utility as a personal tutor in a class they struggle in. They lack awareness of the way they actually use the AI and have a skewed perception of their understanding of the material.

Now imagine another student in the same class. She once attended a STEM-focused summer camp and is familiar with the frustration of learning to code. She does not find it easy, but has the experience behind her to know she is capable of producing working output.

When completing the same assignment, the student carefully reads the problem description and begins structuring her solution by naming variables and adding comments to outline her approach. As she types, the AI-powered code suggestion tool provides frequent input, which she occasionally glances at but mostly ignores, preferring to follow her own plan. When she does accept suggestions, they are small and deliberate – filling in predictable elements like closing brackets or simple conditionals. While she encounters a few syntax mistakes, she methodically corrects them and successfully completes the assignment, passing all test cases in a short time. Looking back, she acknowledges that AI helped her move faster but credits her own structured thinking for getting to the right solution.

Two beginner programmers are depicted. One is struggling to learn programming and one is not, one offloads their thinking to AI and misses crucial concepts, and one prioritizes the thinking skills.

The example above is not hypothetical. This scenario was illustrated in a 2024 study about AI’s role in the widening gap between struggling and non-struggling students. Although it may seem counterintuitive, the emergence of AI being there at any moment to write code for us might mean an increased emphasis on writing more of it by hand, at least in the beginning. 

Considering this, we’ve introduced several AI-powered features in our plugin, including machine translation for course content, theory lookup, and AI hints. The goal is not to avoid AI entirely but to learn how to think effectively alongside it. The following five lessons will help you develop the skills and practices you’ll need to navigate AI tools and become a stronger, more independent programmer.

If you missed it, read part one of this series: Is it Still Worth Learning to Code?

Focus on problem solving, not output

Pauses in programming are useful, even if they feel like getting stuck. Novice programmers are often surprised at how much time will go into a single function or even a single line of working code. This slow and often frustrating process is necessary for building the kind of cognitive processes you’ll need to become a better programmer.

Refining your thinking will also improve your ability to quickly read and understand code you haven’t written yourself. While this has always been important for collaboration, now that we have AI code assistants, developers are reading a lot more code than they used to. If a large-language model autocompletes your function, you want to be able to quickly accept or reject the suggestion without getting caught up in understanding the logic of it.

Hack your own psychology

If there’s one idea that should leave the gated garden of research and make its way into classrooms immediately, it’s the concept of meta-cognitive awareness. Granted, the reason it hasn’t is probably because “meta-cognitive awareness” is not a very enticing term – but the idea is quite simple. It’s about your ability to recognize “thinking traps” and effectively problem-solve your way out of them.

Research has shown that teaching beginners about these challenges produces immediate and lasting changes to the students’ productivity, independence, and confidence. Given that, it might be good to take the time to learn them!

Here are a few meta-cognitive difficulties or “thinking traps” common in programming:

  1. Right question, wrong answer (Forming) – You understand the problem, but you’re using the wrong approach to solve it.
  2. Stuck in a Rut (Dislodging) – Even when you realize your approach isn’t working, you struggle to change it. 
  3. Wrong question, right answer (Assumption) – You perfectly solve a problem… just not the one you were supposed to.
  4. So close, but so far (Location) – You zoom through the steps too fast, thinking you’re almost done, only to realize you skipped something crucial.
  5. Band-aid on a broken bone (Achievement) – You keep making small fixes in hopes your code will start working, but actually, it needs a total overhaul.

Interestingly, researchers found that rather than helping with these challenges, AI actually introduced new meta-cognitive difficulties for beginners. Namely, 

  1. Falling Behind Without Noticing (Progression) – You think you’re keeping up with the course, but because AI assistance can generate working code that surpasses your current understanding, you’re falling behind and don’t realize it.
  2. Distracting Pop-Ups (Interruption) – Every time you try to focus, an AI code-completion tool throws a suggestion at you, breaking your train of thought. 
  3. Following bad advice (Mislead) – You trust a suggestion (from an AI, a tutorial, or even your own guess) that seems right but actually takes you in the wrong direction.

At the moment, most AI tools are not built with these challenges in mind. Even if they were, you are the sole expert of your own mind, and there is only so much an external resource can do to see the traps in your thoughts.

Don’t rush too quickly towards ill-conceived code

Although it looks good in the movies, speed-coding is unproductive for learning. Much of getting through your first programming assignments involves taking the time to understand the problem and then properly strategizing a solution. Both of these are mental processes and should be done before you start coding! While it’s satisfying to generate a lot of code very quickly – in practice, the faster you write the code, the more time you have to spend debugging it

Don’t make the classic mistake of grinding through a vague idea until you’re left with a steaming pile of broken syntax and semantic errors you’ve put five hours into debugging and are too invested in to rebuild the right way. Much of that time would be better spent working out the data structures and program architecture before you write a single line. Once the logic of your program is solid in your mind, implementing it just becomes a matter of syntax.

Take steps to avoid the illusion of competence

Many novice programmers in the study above confidently believed they had solved a programming problem using AI tools, but missed the central lesson of the assignment. This unwarranted confidence, described as an illusion of competence, was compounded by the fact that using too many AI suggestions​ contributed to a lack of awareness of what was holding them back. 

Research uses the term self-efficacy to describe the confidence people have in their ability to complete specific tasks. A healthy level of self-efficacy fosters persistence and engagement, but when you overestimate your abilities, you may neglect critical reflection and fail to address gaps in your knowledge.

While the illusion of competence can occur regardless of the tools used, AI can amplify it. By providing ready-made suggestions or solutions, AI might give you the false impression that you have mastered a concept, even if you struggle to apply it independently.

Here are some suggestions for avoiding this illusion in your own learning:

  1. Prioritize active learning above all else: Writing code, debugging, and breaking down problems actively engages the brain more than reading or copying solutions. This engaged state is the key to activating the neural circuitry necessary for learning. 
  2. Try rubber duck debugging: Instead of going to an AI assistant when you get stuck, try the tested and true technique of rubber duck debugging, where you attempt to explain what the faulty code is doing, step by step, out loud. This technique helps you translate a vague intuitive understanding into concrete sentences, which almost always helps you see what needs to change.
  3. Teach a beginner what you’re learning: Even if you only know the basics, teaching someone else to program is genuinely one of the most underrated educational tactics there is. Novices usually ask questions that can reveal bigger ideas about the material you may have missed.
  4. Code replays and critique: Anything worth doing is worth doing well. Seeking out peer reviews, instructor feedback, or even automated tools that offer detailed critiques can highlight areas of misunderstanding. This extra step will pay off.
  5. Reframe mistakes as “negative expertise”: Even if your DIY code is rife with bugs and flawed approaches, learning to be a good programmer is as much about knowing what doesn’t work as it is about knowing what does.
  6. Build confidence without sophisticated tools: Challenge yourself to solve your next assignment without using an LLM or stack overflow. By depriving yourself of easy answers, you build stronger coding muscles. You may go back to the tools eventually, but these sessions can help build confidence and awareness of your understanding.

Understand the emotions of learning

All coders know that the mind of a programmer often oscillates between two extremes: there is either the ecstatic rush of implementing perfectly working code or overwhelming, frustrated confusion. Whether you’ve been coding for a week or a lifetime, this emotional experience is pretty much the same. The trick is to learn to work with and through these experiences, not against them.

To truly sustain your programming practice, you should work to foster true confidence, develop a productive response to frustration, let yourself be inspired to play and be creative, and take satisfaction and pride in your work. Understand that these are almost more important than the information you study, because they determine your attitude to programming. Developing and maintaining the belief that you are someone who enjoys programming will serve you well beyond the ability to work out each step of a sorting algorithm by hand.

This is the second post in our series How to Learn to Program in an AI World, keep an eye out for the next ones on our blog in the coming months. If you missed it, check out part 1: Is it still worth learning to code?