Mindset Mondays: Week 8 – Perseverance in Coding - Department of Computer Science - Purdue University Skip to main content

Week 8: Perseverance in Coding

Persistence powers problem-solving.

Objective: Students will learn the importance of perseverance in coding by practicing strategies to tackle complex problems step-by-step and reflecting on their problem-solving process.


Why It Matters

Coding is inherently problem-solving, and challenges are a natural part of the process. Learning how to stay persistent and approach problems methodically helps students develop resilience, critical thinking, and confidence.

As a personal reflection, I remember a time when I spent hours debugging a program that just wouldn’t work. The frustration was real, but taking a step back and breaking the issue into smaller pieces led to a breakthrough. That experience taught me that patience and persistence often yield the most rewarding outcomes.

It’s also important to remember that it’s okay to take a brain break. Stepping away for a few moments to reset can clear your mind and make tackling the challenge much easier. Encouraging students to take breaks and return with a fresh perspective is a powerful strategy for perseverance.


Main Activities

Class Discussion: What Makes Coding Challenging?

  • Open with a question: "What do you find most challenging about coding or solving problems?"
  • Discuss common frustrations (e.g., debugging, understanding syntax) and why perseverance is key to overcoming these challenges.
    • Debugging a program where the error isn’t immediately clear.
      • Example: A missing semicolon or a typo in a variable name causing the code to fail.
    • Understanding syntax in a new programming language.
      • Example: Mixing up Python indentation rules or forgetting to include parentheses in function calls.
    • Facing a logic error that produces unexpected results.
      • Example: Writing a loop that runs infinitely because the exit condition is incorrect.
    • Feeling stuck when a solution doesn’t work after multiple attempts.
      • Example: Trying to build a program that sorts numbers but encountering incorrect output repeatedly.
Discuss how these challenges are common and why perseverance—such as breaking problems into smaller steps or seeking help—is essential to overcoming them.

Coding Challenge: Break It Down

  • Provide a simple coding problem (e.g., writing a loop, debugging a small program).
  • Walk through a structured process:
    • Understand the problem.
    • Break it into smaller tasks.
    • Work step-by-step and test frequently.
    • Reflect on what works and adjust.
  • Activity: Students work individually or in pairs to solve the problem using this method.

 

Reflection and Sharing 

  • Discuss as a class:
    • "What strategies helped you solve the problem?"
    • "What did you do when you felt stuck?"
  • Highlight the value of persistence and iterative problem-solving.

Coming Soon: Video Insight

We’re excited to bring you an exclusive video featuring professors or students sharing their experiences with perseverance in coding. Stay tuned to hear real-world stories about overcoming challenges and achieving success through persistence.


Journal Prompt

"Reflect on today’s coding challenge. What steps did you take to solve the problem? How did you feel during the process, and what did you learn about perseverance?"


Mindset Mantra

"Step by step, we solve."


Teacher’s Note

  • Share your own experiences with coding challenges and how you worked through them.
  • Encourage students to support one another during coding activities to create a collaborative environment.

 

Acknowledgment:

This lesson plan was developed collaboratively with OpenAI’s ChatGPT, blending expert insights with creative tools to support educators in fostering growth mindset concepts in the classroom.

Last Updated: Dec 19, 2024 4:15 PM

Department of Computer Science, 305 N. University Street, West Lafayette, IN 47907

Purdue University Indianapolis, 723 W. Michigan St., Indianapolis, IN 46202

Phone: (765) 494-6010 • Fax: (765) 494-0739

Copyright © 2024 Purdue University | An equal access/equal opportunity university | Copyright Complaints | DOE Degree Scorecards

Trouble with this page? Accessibility issues? Please contact the College of Science.