From Code Chaos to AI Clarity: Teaching Students to Think Before They Type

From Code Chaos to AI Clarity: Teaching Students
to Think Before They Type
A Story by Dr. Denis Jacob Machado
Assistant Professor at UNC Charlotte Dept. of Bioinformatics and Genomics
Email: dmachado@charlotte.edu
Website: phyloinformatics.com
Then
Fall 2022. I’m standing in front of a classroom full of bioinformatics students, watching as they furiously type into their laptops.
Not coding—just…typing.
Some are Googling frantically.
Others are staring blankly at a terminal window, hoping Python will magically generate results from sheer willpower.
“Okay,”
I say, trying to regain control.
“Who has a plan?”
Silence.
I already know the answer:
This was Machine Learning in Bioinformatics, and I had made the (adorable) assumption that my students would naturally break problems down before jumping into coding. Instead, they were treating Python like a foreign language they hoped to learn through immersion—by drowning in error messages.
After multiple office hours filled with confused students showing me tangled, copy-pasted AI-generated code they barely understood, I realized something:
Idea
At this point, I had two options. I could warn students against AI tools like ChatGPT or Gemini, telling them not to rely on them blindly. Or—I could teach them how to use these tools properly.
Instead of fearing AI, I started thinking about how to incorporate it as a learning tool. What if, rather than letting students generate complete, messy scripts and hope for the best, I taught them how to break a problem into smaller components first?
Before they could ask AI for help, they had to:
- Describe each sub-problem separately – Instead of dumping a huge question into ChatGPT, they had to refine their prompt into smaller, well-structured pieces.
- Solve the problem conceptually – No code, just thinking.
- Write a pseudocode outline – List every major step needed.
This wasn’t just about making AI-generated responses better (though it certainly helped).
Now
Spring 2025, Programming II. Different class, same challenge
Before my students even think about opening a coding environment, they must
- solve the problem on paper,
- write a pseudocode outline, and
- refine it into a well-structured prompt for generative AI.
Now, instead of mindlessly asking ChatGPT to “write a Python script for XYZ,”
they’re crafting prompts like:
“I want to write a Bash script that automates file renaming. It should take a directory as input, add a timestamp to each filename, and handle errors gracefully.
Here’s my pseudocode: …”
Guess what happens? AI gives them actual useful code—because they gave it something useful to work with!
And even better:
What I’ve learned
Teaching programming in the age of AI isn’t about resisting automation—it’s about teaching students how to think. By making them break down problems, articulate solutions in pseudocode, and then leverage AI, they’re developing the core skills that will be relevant no matter how powerful AI becomes.