Share Your Experience: Take the 2024 Developer Survey

# Tag Info

Accepted

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

Buffy's lovely answer shows well how two variables can refer to the same thing, but since we are in early cognitive development and working with Scratch, in which you can't pass parameters, and can't ...
• 33.7k

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

My usual explanation is related to names; specifically names of people. People have names. The names are not the people, but can be used to refer to the people. Some people don't have any names at ...
• 36.4k

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

What about You have alot of values that you need to remember, so you put a label on each one (a little piece of paper to remind you what this value means) so you can find the value easily when you ...
• 369
Accepted

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

I actually cover this idea in my very first lesson in AP Computer Science, because I have found that students find the different uses of = to be confusing, indeed. ...
• 33.7k

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

When I have taught this, I have said that = in programming is just a different thing to = in maths. It's unfortunate that ...

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

The variable that children are most familiar with is score: whether in computer games, sports or board games, a child will almost certainly understand that a score is a value that is clearly not ...
• 251

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

If your students are coming from a math background, teach them that in most programming languages, all variables have a hidden subscript on them corresponding to a time/step-number (i.e. they're ...
Accepted

### Order to Teach Topics in an Intro Programming Class

I think this depends entirely on the programming language you use. Or maybe more accurately, you should choose a language that allows you to introduce the concepts in the order you want. I would use ...
• 5,420

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

Memory is a linear sequence of storage locations. Like a lined sheet of paper. Take a lined sheet of paper and choose a line. In the left margin, write a label. The variable is that label - it ...
• 121

### Order to Teach Topics in an Intro Programming Class

I'm self-taught, but here are my thoughts. 0. Language I learned using a combination of Python (once I started to get more serious about programming, I actually don't remember how I stumbled across ...
• 4,724

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

I'm going to explore an orthogonal concept that sheds light on the question at hand: What is a variable? In mathematics a variable is a representative for some value, a name. It may be a name for ...
• 36.4k

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

When and how should the differences be pointed out to students? When: As soon as you introduce one of those operators... On the "how" - I'd try to not beat around the bush, so to speak, but to point ...
• 1,469

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

I just saw Buffy's answer so all credits to @Buffy and though I could simplify it with one word in a way that 9 year old me would have understood. (Although bear in mind I was also mucking around ...
• 171

### Concept of variable

Why complicate matters with contrived analogies like hotel rooms and guests? It is much more straightforward to take the analogy of a simple paper "form" (which absolutely everyone in ...
• 491

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

I personally teach mutation almost immediately. However, I agree with Buffy that more difficult is not really the metric people are using to decide to teach mutation later. It is about giving ...
• 33.7k

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

All of the below is meant to be thoughts/analogies/illustrations to help explain the difference (meant to be said to students) but in reality, this is all dependent on the level of your students. The ...
• 4,724

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

I don't teach CS in any official capacity but I have tutored a number of friends and colleagues on the basics. I find that differentiating the language I use when describing the different concepts ...
• 171

### Order to Teach Topics in an Intro Programming Class

In Structure and Interpretation of Computer Programs (SICP) (a book, video series, and university course), they do not cover variable mutation until around half way. They covered what seemed like ...
• 10.7k

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

It might be a bit indirect but around that age I bootstrapped myself from fill in the blank math problems through basic algebra to more generalized variable use. eg I started with having been given ...

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

If I remember correctly, Scratch has two kinds of variables - object-bound and global. When teaching my son about Scratch, at the time of introducing variables I told him he had been working with ...
• 61

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

I think that this is an interesting question, and one the textbooks often ignore or treat as unimportant. I've noticed it because I end up teaching Python, Java and C++ and have seen how my student's ...

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

I am not aware that cognitive modeling of memory structures in early programming education has been directly studied, so anything that I say here is entirely speculative. However, I suspect that the ...
• 33.7k
Accepted

### Concept of variable

The use of an analogy is to provide a familiar jumping-off point to introduce something new. Since variables are unique features of computing systems, different from how anything else in the universe ...
• 937

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

I would generalise this, because other symbols and terminology are also affected (">" or textual statements such as commands). Start by explaining that symbols and terms in each language have ...
• 211

### How do I teach "math equality" vs. "CS assignment" vs. "CS equality logic operator"?

I've not tried the following, so I'm unable to vouch for their effectiveness, but if you're looking for suggestions: Avoid assigning variables directly (i.e. x = y) Hide the implementation in ...

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

The concept of a variable is not hard in and of itself, but it is the first conceptual hurdle for students. The problem is that in common usage we use the same symbol for comparison and immutable ...
• 998

### Order to Teach Topics in an Intro Programming Class

I am of the school of thinking that starting at an abstract level causes too many students to consider computation as inscrutable magic. And that can lead to broken mental models and buggy ideas ...
• 1,903