# Tag Info

## Hot answers tagged lesson-ideas

### What are good examples that actually motivate the study of recursion?

I find a very easy to understand example for recursion is the folder structure on a computer. Look through all folders (within a certain location) and... list all .doc files, for example. First, you ...
• 981
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

### Real life examples of 0-indexing

You can get at this concept very intuitively in strings before you ever get to arrays. Take a string like "hello world" and ask them a subtle-sounding point: does the string begin here: ...
• 33.7k

### Real life examples of 0-indexing

Ages in the United States (it's not the same around the world). For the first year of life, children are 0 years old. Only after completion of a year is the age changed to 1. By this logic, a child ...
• 9,102
Accepted

### Interesting Programming Exercises to Teach Inheritance?

I'm not as familiar with Python as I am with other languages, but I'm sure your students have played Minecraft. If you haven't, I suggest taking a few minutes to find some introductory "Lets Play" ...

### 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

### Real life examples of 0-indexing

An analogy that will work well in Europe, but not in North America: Image licensed under the CC BY-SA 3.0 by Bidgee of Wikimedia Commons. Floors (in European countries) are typically numbered with 0 ...
• 3,516
Accepted

### Demonstrating the possible dangers of SQL injection

The best way to show your students that their work is vulnerable to SQL injection is to demonstrate it. I'd suggest that you challenge the students to "hack" each others projects using SQL injection. ...
• 4,795

### How to teach Stack Overflow more efficiently?

I don't think the core issue is that some students are bad at using Stack Overflow -- I view that more as a symptom of a deeper root problem. When somebody doesn't seem to be able to productively ask ...
• 4,005

### What are good examples that actually motivate the study of recursion?

One good example is to make permutations of all of the letters in a word of arbitrary length. It's quite tricky to do iteratively, since you essentially have to recreate the program stack to get it ...
• 33.7k

### 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

### Real life examples of 0-indexing

The clock (24 hours system) If we look at the clock, we have two examples of counting hours. The 24 hour system starts at 0. The 12 hour system is interesting, neither starting at 0 or 1. The 12-hour ...
• 10.7k

### How do you teach Big O to high schoolers with varying degrees of math exposure?

One good overall educational strategy is to teach the same thing to students repeatedly, using a Spiral approach, in which each turn of the spiral teaches at a deeper level. Don't expect the students ...
• 36.4k

### How to teach the value of the command line in high school?

I can't speak to cloud9 but I've always taught on Linux and am a CLI wonk. One thing I do is differentiate between user friendly and learner friendly. GUI interfaces are learner friendly - they're ...
• 1,572

### What are good examples that actually motivate the study of recursion?

Writing recursive code to output the Snowflake Curve (Koch snowflake) was something that definitely pushed my buttons early on. It's formed as follows: The Koch snowflake can be constructed by ...
• 311
Accepted

### How to respond when students ask "is recursion good practice"?

Quite honestly, I would be upfront with them about the debate. Send them to a couple other SE threads: Efficiency: recursion vs loop “Necessary” Uses of Recursion in Imperative Languages Are ...
• 9,102

### What are good examples that actually motivate the study of recursion?

Other than the obvious merge sort, I really like the minimax algorithm, especially when applied to creating a computer player of a simple game. Start with something simple like tic-tac-toe. When it's ...
• 5,430

### How to teach the value of the command line in high school?

One way to show them the value of the command line would be to juxtapose doing a task with a GUI and with the command line. You could do something like the following: Create a directory with mixed ...
• 191

### Non-native English speakers struggle to come up with decent variable names and function names

The point of good variable/function/class naming is to express problem semantics to readers, including the programmers. If your readers are primarily French speakers, use good French naming for ...
• 36.4k

### Demonstrating the possible dangers of SQL injection

A couple suggestions - The classic xkcd comic about Bobby Tables: Shown, complete with the explain xkcd article can provide a nice, humorous introduction that will get them to start paying to ...
• 4,724

### Explaining why styling should not be done directly in HTML

I like the idea of producing a few style sheets, and having the pupils apply them to their HTML. They can then see the power of having separate style sheets. Start with a style sheet that you made. ...
• 10.7k

### Interesting Programming Exercises to Teach Inheritance?

Too many examples that you find are (IMO) fatally flawed. The Animal->Dog is especially flawed, though widely used. The problem is that these sorts of examples almost require that the superclass has a ...
• 36.4k

### How to respond when students ask "is recursion good practice"?

When I teach recursion, even if I am not at a point in the curriculum where it is possible to introduce trees in coding problems, I always at least provide a high level discussion of trees, and the ...
• 271
Accepted

### How to teach the value of the command line in high school?

You can't teach the value of the command line. You can, however, sell it. Students have at least one of two primary goals in any class: Get good grades (pass the class) Learn something they like ...
• 5,445

### 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
Accepted

### How do I approach teaching Python to 12-year-olds as a first-time teacher?

Check out the Python books written by Al Sweigart. His homepage Invent with Python includes some great, free resources that are geared to the age range of your students. In particular he focuses on ...
• 9,102

### What are good examples that actually motivate the study of recursion?

I'm going to focus on student's understanding recursion at a fairly deep level, rather than coding. First, to really understand recursion you need a sense of its parts. There is the base case, of ...
• 36.4k

### How to teach the value of the command line in high school?

Not a demonstration, but maybe a nice thought to tell your students. I read a nice analogy a few months ago, linked from a question somewhere on stackexchange: Using a computer only with a GUI is ...
• 221
Accepted

### How to stress the importance of testing code?

Introduce test-driven development. TDD and agile methods of development are very popular at the minute, and for good reason — you know, ahead of time, exactly what each part of the program must ...
• 3,516