Skip to main content
CS Teaching Tips

Main navigation

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

Misconception: Students think that when they create a new variable within a function, that function will automatically return that variable’s value when executed.

Share Misconception: Students think that when they create a new variable within a function, that function will automatically return that variable’s value when executed. with FacebookShare Misconception: Students think that when they create a new variable within a function, that function will automatically return that variable’s value when executed. with Twitter
  • For example, students think that by assigning result = 2 in a function, the function will return 2.

More about this tip

Tags

  • Content Misconceptions
  • CS 1
  • Intro Programming
External Source

"Exploring programming misconceptions: an analysis of student mistakes in visual program simulation exercises" by Teemu Sirkiä and Juha Sorva.

Other Tips By
Other Tips By Juha Sorva
Juha Sorva

Similar tips

Organize an activity in which one student gives other students precise instructions for how to draw a certain picture to teach students how a computer executes code.
Insist students use Javadocs as a resource in intro Java classes to reinforce the value of self-directed learning and ensure they know how to reference important documentation.
Have students design a program in Python that performs various sound-processing tasks to give them a fun way to practice using variables, assignments, if-statements, and functions.
  • 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