Teach students how to debug with print statements before teaching them to use a debugger.

  • Ask students to think about the best places to put a print statement to help them practice solving their problems on their own when helping students debug.
    • Have students spend 5 or 10 minutes reading through their code before adding print statements.
    • Alternatively, give students a piece of correct code and ask them where they would put print statements to prove it works.
  • You want students to be able to effectively use the straightforward debugging techniques before moving on to teaching more advanced material. 
  • Print statements are a crucial first step for effective debugging skills.

More about this tip

External Source

Interview with Leo Porter.

 

Other Tips By