Questions tagged [variables]

Please use this tag in the context the teaching of computer science, where a variable may be thought of as a storage location paired with an identifier (a name) which holds a value that can be retrieved by referencing the name. Do not use in the context of mathematics, where a variable is an unknown to be solved for.

Filter by
Sorted by
Tagged with
85
votes
26answers
25k views

How to explain the concept of a variable to a 9-year old?

My 9 year old daughter is heavily interested in science, robots, computers, … She asked me if I could teach her how to program a computer. So, we started with Scratch, a programming language ...
26
votes
13answers
5k views

How do I teach “math equality” vs. “CS assignment” vs. “CS equality logic operator”?

Consider the following three uses of equality: In mathematics, the statement $x = x^2$ In Python, the statement x = x**2 In Python, the expression, ...
17
votes
6answers
2k views

Order to Teach Topics in an Intro Programming Class

This is a question for those of you who have an intro class before AP Computer Science (or maybe even just an intro class). What order do you teach the topics in your intro class? I start with if ...
11
votes
3answers
378 views

Do Python and Java lead students to construct different mental models of memory?

How are novices' mental models of variable storage affected by programming language choices? Most Intro to CS teachers (I think) do not delve with breadth and depth into details of how variable names ...
5
votes
4answers
168 views

Why would mutation be considered by some as a difficult concept to grasp?

Why do some instructors delay teaching mutation due to considering it to be a more difficult concept? (than functional or recursive concepts, etc.) It is very likely that, back in the 8-bit PC days, ...
5
votes
2answers
57 views

App Lab/JS confusion between strings and variables

In my APCSP class (using app lab, which is javascript based), I noticed that there are many students who struggle with the difference between a string ("foo") and a ...
5
votes
2answers
104 views

Intensive basic VBA course - which variables to teach?

Which variable types are the bare minimum to teach non-programmers who want to be able to create and modify simple VBA (MS Office) macros? I start by showing them the concept of variables through ...