Skip to main content


Encouraging Student Persistence

Framing Coding Setbacks as Opportunities for Growth at Code Next

Code Next—Google’s out-of-school computer science program for high school students of color in Oakland, California, and New York City—encourages participants to pursue careers in computer science and related fields. As the research partner with Code Next, the Education Development Center (EDC) interviewed several participants as they advanced through the four-year program. One theme that emerged from those conversations with Code Next participants was a shift in students’ perceptions of failure and their sense of success, confidence, and ultimately their perseverance in the program. When students begin to see coding setbacks as learning opportunities or as an integral part of becoming a programmer, they feel more successful as coders.

In order for me to have successes I have to fail a little bit. I fail a lot because that's what coding is. You have to fail over and over and over again, and then you get the hang of it.

—Lorena, 9th grader

“Lorena” joined Code Next from a school with limited access to computer science in Oakland. She experienced the common frustrations of new coders—encountering and resolving coding errors. Lorena remarked that one of the highlights of Code Next was realizing that working through errors is an essential part of an ongoing learning process for both novice and advanced programmers, "It’s okay not to understand sometimes and just push through […] all coders don't start off knowing everything, you know, they're not like geniuses. They just practice a lot. And, I don't know, that made me feel a little bit better, like, more confident in class."

Novice coders can feel overwhelmed because they may not understand the extent to which errors serve as building blocks for learning to code. “Eric” joined Code Next in the ninth grade with no previous coding experience, and he worried he was falling behind his peers. Eric doubted his ability to move beyond his setbacks until he was reassured by his Code Next coach that mistakes and feelings of inadequacy are common among coders, even for the coaches themselves. As Eric explained, "I really just felt dumb, like, ‘Wow, I'm not getting this, and everybody else seems to be getting it.’ So I did feel unsuccessful. As time went on, I started to grasp it more and more, and I realized that it's okay to not get it."

Below are some of the ways Code Next coaches help their students learn to persist and see bugs and errors as steps to deeper understanding.

Practice Builds Confidence and Competency

Using culturally meaningful projects to keep students engaged, coaches encourage and gently push students to work through bugs and errors to create their products. Personalized or culturally relevant projects include developing an app to address needs in the community or creating role-playing games, such as a young Latina navigating college life. Keeping the students moving forward helps cultivate intrinsic motivation and persistence by communicating to the students the following three elements:

  • Errors are inevitable: Encountering and resolving errors is a fundamental part of learning to code. It is important for educators to reiterate to students that bugs, typos, and errors serve to progressively grow and build coding expertise. If coding errors are expected, and even encouraged, new coders like Eric are more likely to ask questions, become more confident coders, and persist through their coding hurdles.
  • Redefine failure: Learning to code offers many ways to “get it wrong,” and it is often difficult for many students not to associate errors with failure. It is important, particularly with new coders, to foster a learning environment that frames coding errors and debugging as ongoing opportunities for growth. Debugging is a constant and valuable part of writing code.
  • Model overcoming setbacks: Students benefit from hearing and seeing the ways in which “experts,” their instructors, continue to overcome and learn from setbacks as they advance as coders. Framing the errors as a common experience for all coders—rather than a reflection of innate ability—can help students bounce back from setbacks, problem solve, and learn from their mistakes.


Vanora Thomas ( is a researcher at Education Development Center (EDC) in Oakland, California. Peta-Gay Clarke ( is a Diversity Manager at Google and the Program Lead for Google Code Next in New York City

citation: Thomas, V., and P.-G. Clarke. 2021. Encouraging student persistence: Framing coding setbacks as opportunities for growth at Code Next. Connected Science Learning 3 (2).

Computer Science STEM Teaching Strategies High School Informal Education

Asset 2