Skip to main content
CS Teaching Tips

Main navigation

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

Misconception: Students often have off by 1 errors when working with loops, which can result from mixing up > and >= as well as forgetting that arrays start at index 0.

  • If students are repeatedly encountering off-by-1 errors, it may be the result of difficulty understanding either of this concepts.

More about this tip

Tags

  • CS 1
  • Intro Programming
  • Data Structures
  • Content Misconceptions
External Source

Interview with Michael Lee.

Other Tips By
Other Tips By Michael Lee

Similar tips

When explaining code to the class, project your code and use a tablet to draw on top of it. Ask students for debugging suggestions to make them more comfortable finding bugs and to show them that all programmers, even you, make mistakes.
Draw attention to types when teaching students Python to help lay the groundwork for understanding types in lower-level programming languages they’ll learn about later.
Have students write a program that constructs an n x n Magic Square in Java so they gain practice working with bounds in 2D arrays.

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

Privacy Policy