Skip to main content
CS Teaching Tips

Main navigation

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

Don’t allow repeat variable names in intro courses to avoid confusion about different variables with the same name.

Share Don’t allow repeat variable names in intro courses to avoid confusion about different variables with the same name. with FacebookShare Don’t allow repeat variable names in intro courses to avoid confusion about different variables with the same name. with Twitter
  • If you try to explain that you can have two variables named the same thing in different parts of your program to introductory students, it’s likely you’ll be met with blank stares.
  • This concept is best left for later courses, or much later in the year, when students have a better understanding of the basics.

More about this tip

Tags

  • CS 1
  • Intro Programming
External Source

Interview with Dani McAvoy

Other Tips By
Other Tips By Dani McAvoy

Similar tips

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.
As a final project, have students create a generic side-scrolling game in Java so they can creatively showcase their object-oriented programming abilities.
Misconception: Students don’t understand that the right side of an assignment statement is executed before the assignment. They think that variables store unresolved equations.
  • CSTT Facebook
  • CSTT Twitter

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

Privacy Policy

  • National Science Foundation
  • Sage Fox Group
  • Harvey Mudd College