Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Have students pay special attention to “off by one” bugs to help them avoid common mistakes in their code.

  • These are errors that do not account for edge cases; most frequently, the first or last element.

More about this tip

Tags

  • Development Methods
External Source

Interview with Jim Huggins

Other Tips By
Other Tips By Jim Huggins

Similar tips

Teach nested loops using ASCII art, building from triangles to diamonds through iteration.
Encourage students to get the for-loop counter right before adding code inside the for loop this will reduce the amount of time spent troubleshooting for-loops and ensure students are scaffolded well.
Have each student contribute test cases to a class-wide testing suite for assignments in order to get students thinking about edge cases and improving their implementations.

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Powered by Drupal.

Privacy Policy