Skip to main content

Questions tagged [lesson-ideas]

Questions with this tag relate to planning lessons for a specific purpose, such as teaching some coding paradigm or skill. Planning lessons in Computer Science depends on the context and level of the students. If it is a lesson which introduces a new topic, the tag [introductory-lesson] may also be appropriate.

Filter by
Sorted by
Tagged with
88 votes
26 answers
30k 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 ...
Golo Roden's user avatar
67 votes
21 answers
19k views

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

One of the traps of imperative-first is how difficult it becomes to help students make sense of recursion when they finally encounter it. And if those kids are fairly competent iterative programmers, ...
Ben I.'s user avatar
  • 33.7k
52 votes
14 answers
11k views

Interesting Programming Exercises to Teach Inheritance?

I originally asked this over on Stack Overflow, but they suggested I look here instead: I'm currently teaching my students about the concept of inheritance (we're using Python 3) but am unable to ...
Patch's user avatar
  • 631
45 votes
21 answers
5k views

Real life examples of 0-indexing

It can be perplexing for students to begin counting at 0 when they enter a CS class. I made it a point over and over to talk about "Day 0" and "Week 0" in the opening days and weeks just to build ...
Peter's user avatar
  • 9,102
44 votes
22 answers
9k views

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

Part of what I love about the particular adaptation I use for AP CS Principles — CS50 AP — is that my curriculum teaches students basic Linux shell commands in the Cloud9 IDE. Students learn things ...
Peter's user avatar
  • 9,102
34 votes
7 answers
3k views

How to teach Stack Overflow more efficiently?

As evidenced by the numerous poorly asked questions by students on Stack Overflow, it is clear that many students have difficulty understanding how to ask questions there. Even as teachers, we often ...
user2709's user avatar
  • 349
30 votes
13 answers
6k views

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

Context: CS1-style, intro programming class, using an interpreted language (Python). I will get a hand raised asking "Why are we learning recursion? Is it good programming practice?" My response is ...
GermaneDork's user avatar
25 votes
10 answers
7k views

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

The students I teach at a middle school in Beijing normally have a limited vocabulary. They struggle to come up with decent variable names and function names. Most of the time they just name variables ...
Qiulang 邱朗's user avatar
18 votes
6 answers
7k views

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

My second semester programming curriculum includes a searching and sorting unit and mentions Big O notation, giving the notation for each search and sort we implement. It does not show the ...
Java Jive's user avatar
  • 2,359
17 votes
8 answers
5k views

Demonstrating the possible dangers of SQL injection

Students building websites in a high-school computer science major (using HTML, javascript, ...
ItamarG3's user avatar
  • 6,312
17 votes
10 answers
7k views

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

I'm currently teaching Python, to three 12-year-olds. They have no experience at all, and my task is to introduce them to programming concepts, and to Python. I'm fairly experienced in programming, ...
kosciCZ's user avatar
  • 173
16 votes
8 answers
722 views

How can I convey the idea of a programming language vs. a markup language?

When I try and teach web development to absolute beginners, I seem to always get a question about the roles of HTML/CSS/JS and about how the browser renders the HTML. It seems to me that the confusion ...
thesecretmaster's user avatar
  • 4,795
16 votes
3 answers
863 views

What are effective approaches for teaching dynamic programming?

Dynamic programming is a subject that's notoriously difficult to learn and to teach. It's one thing to educate oneself, say by reading the appropriate chapters in Kleinberg & Tardos or CLRS, and ...
Andrew Sundstrom's user avatar
15 votes
9 answers
1k views

Computers are down; what's in your bag of tricks for teaching CS when they can't get on a computer?

I'm guessing everyone here, high school teachers at least, have spent at least one period in the past year working with a class when you either don't have working computers or a working internet ...
Ryan Nutt's user avatar
  • 3,009
14 votes
11 answers
683 views

How can I show the value of best practices?

As someone who likes to advocate for best practices like correct use of VCS, indentation, sufficient commenting, and testing, I try and integrate them when I teach. But for all of these things, my ...
thesecretmaster's user avatar
  • 4,795
14 votes
5 answers
2k views

Effectiveness of Parsons Problems

I first heard of Parsons Problems thanks to CS Teaching Tips. They define these problems as follows: "Parsons problems are problems where students build programs from ordering small chunks of ...
Peter's user avatar
  • 9,102
13 votes
17 answers
4k views

What are some fun projects for non-CS majors?

I'm teaching an undergrad Intro to Programming for Non-majors this semester (in Python) and I'm looking for some fun projects for my students that are engaging but not too difficult for them. This is ...
Levon's user avatar
  • 371
13 votes
12 answers
3k views

What is a good analogy for pass by value vs by reference?

In general, there are two ways arguments can be passed to a function. Functions can either be passed a reference to an object, or the value of that object. This is something that my students often ...
thesecretmaster's user avatar
  • 4,795
12 votes
13 answers
3k views

Explaining why styling should not be done directly in HTML

I recently noticed that <marquee> has been deprecated from html according to this site. From this answer on Stack Overflow, the marquee replacement is made ...
ItamarG3's user avatar
  • 6,312
12 votes
7 answers
767 views

Lesson Idea: Arrays, Pointers, and Syntactic Sugar

One of the most challenging concepts to instill in new CS students is 0-indexing (indeed, the pedagogy of this fact probably merits its own discussion). Another difficult topic -- although a slightly ...
Peter's user avatar
  • 9,102
11 votes
8 answers
674 views

Explaining basic html structure

I am trying to think of a lesson plan about html, and I am looking for a good way to explain the concept of the structure of an html file. I was wondering whether ...
ItamarG3's user avatar
  • 6,312
10 votes
6 answers
343 views

Encourage students to be independent

As is often the case, there is usually more than one way to approach a problem or task. Currently, my students use what they were taught in the lessons (which is expected). When they stumble upon a ...
ItamarG3's user avatar
  • 6,312
10 votes
4 answers
698 views

What would be reasonable to include in an Introduction to AI class for a 7th-8th grade after school program?

The class meets just 8 times for 2.5 hours weekly, aimed at 7-8th graders with very basic programming skills. Possibilities off the top of my head: computer learning (neural nets and/or genetic ...
Dave I's user avatar
  • 181
10 votes
6 answers
1k views

How can I make database normalization more clear?

Database normalization is needlessly clouded by over-explanation. I reviewed a wide array of web articles and several textbooks before starting to teach it. After I became thoroughly familiar with the ...
user avatar
10 votes
2 answers
177 views

Teaching students how to construct regular expressions (and other "translation" style problems)

I'm currently helping teach a unit about languages as a part of a discrete math course -- we're currently focusing on regular expressions, NFAs, DFAs, CFGs, grammars, and the like. One of the skills ...
Michael0x2a's user avatar
  • 4,005
9 votes
7 answers
525 views

Introduction to programming class: use Spreadsheets to introduce fundamentals

Are there any "pros" or "cons" I have overlooked regarding using Excel as a means to introduce a range of fundamental programming concepts. This question relates to teaching a programming module at ...
srattigan's user avatar
  • 744
9 votes
7 answers
1k views

Teaching loop invariant choice

This is in line with a prior question I asked about teaching induction, but this is specific to the loop invariant step. I have not had great success helping my students see how to choose a loop ...
Ben I.'s user avatar
  • 33.7k
9 votes
6 answers
966 views

Helping students adjust to using industrial-strength IDEs

Something I've often observed is that many students find it challenging to figure out how to use full-fledged IDEs such as Eclipse, Netbeans, Visual Studios, IntelliJ, and PyCharm. From what I can ...
Michael0x2a's user avatar
  • 4,005
9 votes
4 answers
368 views

How to effectively teach strings and string literal constants?

I am teaching a general introductory CS course to 18-19 year olds, with Python3 as a support language, and I am not satisfied with how some students respond to strings and string literals. That is ...
ysalmon's user avatar
  • 301
8 votes
11 answers
2k views

How to stress the importance of testing code?

I've run into the issue in the past that students don't test their code, and get into a huge mess when they can't find out what's not working. How can I prove to them (before something like this ...
jacksonwelsh's user avatar
8 votes
5 answers
958 views

Simple Pointer Examples in C

Thanks to feedback in this thread, I'm beginning to plan how to integrate a basic introduction to pointers into my unit on arrays. Here's a sample program I just wrote up: ...
Peter's user avatar
  • 9,102
8 votes
6 answers
427 views

How would you explain what is a race condition to a five years old

TL;DR: How would you explain what is a race condition to a five years old. Which analogy to concepts he is familiar with would you use? Long version: I am not a teacher but a software engineer. ...
Renaud M.'s user avatar
  • 183
8 votes
3 answers
403 views

Teaching Induction to Prove the Correctness of Algorithms

This is a subject that I have had a lot of trouble clarifying for students. I can explain the components well enough, but I have trouble getting kids to connect the big picture of the proof to the ...
Ben I.'s user avatar
  • 33.7k
8 votes
3 answers
240 views

Evaluating resources for teaching myself reinforcement learning

While trying to teach myself the topic of reinforcement learning, I find many sites, books, people and other resources with information about that subject. (I am trying to learn the subject from those ...
ItamarG3's user avatar
  • 6,312
8 votes
2 answers
632 views

Mini-Projects that can be covered in an 1 hour Haskell tutorial

I am supposed to be holding a tutorial session in an Undergraduate Haskell Course, which is also supposed to be a first course in programming for a few of the students. Ideally, the tutorial should be ...
Agnishom Chattopadhyay's user avatar
8 votes
2 answers
195 views

How to teach sums and asymptotics to students who don’t know limits

I am to teach sums and asymptotics to first year CS undergraduates who have only high school math. I thought it would be attractive to follow chapter 14 of https://courses.csail.mit.edu/6.042/...
Simd's user avatar
  • 233
7 votes
8 answers
2k views

Active learning for boolean algebra

I've been thinking about active learning, and I am inspired by Heather's answer to my earlier boolean algebra curriculum review. This may also be a good question for math teachers who have experience ...
Ben I.'s user avatar
  • 33.7k
7 votes
4 answers
1k views

Do you include coding assignments in an intro to complexity and computation course?

In an introductory course on complexity and computing, I am thinking about including some programming tasks. I wonder what types of tasks I could give the students beyond "construct" a ...
0x90's user avatar
  • 171
7 votes
5 answers
212 views

Instructional Methods for In-class Code Demos

When demoing code in class, I have tried at least three different methods of instruction: Write code live and have students type along Write code live and have students follow my logic while only I ...
Peter's user avatar
  • 9,102
7 votes
3 answers
436 views

HS Lessons On Modeling Virus Spread

I'd like to try teaching an online lesson to high school CS students on modeling the spread of a virus. Ideally it would be something that could be coded in a spreadsheet, Code.Org's Game Lab or App ...
dlu's user avatar
  • 499
7 votes
6 answers
733 views

What are good, practical labs and activities for loops?

I am teaching some high school students, also the first time programmers, some basic programming concepts and applications. When introducing loop I find that using it to check prime number (and find ...
Qiulang 邱朗's user avatar
7 votes
2 answers
332 views

Good, Motivating Examples for Algorithmic Complexity

I was recently reading a really good article on this topic, and I realize that it could be a very good added value for students to understand better and appreciate (and eventually put in practice) all ...
Kenny Barrera's user avatar
7 votes
4 answers
583 views

Python function has access to global variables, and doesn't need passed arguments

When teaching functions in Python I get a little annoyed that the code below actually prints out the greeting. I know the preferred way would be to pass in the name, but, for students, if it works ...
tazboy's user avatar
  • 171
7 votes
2 answers
391 views

Peanut Butter and Jelly Ending

Peanut Butter and Jelly Ending I have a task that I started with a group of 4th-6th graders at the beginning of a short course on Artificial Intelligence. In order to demonstrate how exact computers ...
Dave I's user avatar
  • 181
6 votes
4 answers
961 views

How to teach which loop should be used

In most languages, there are many different types of loops. The most common ones seem to be for loop, while loops, and do while loops. What is the best way to illustrate the differences between the ...
i--'s user avatar
  • 831
6 votes
5 answers
913 views

What is a good teaching example/application for jagged arrays (2d arrays with irregular row lengths)?

We are teaching an AP CS class and the topic of 2d-arrays is coming up. There are plenty of cool and approachable sample applications for standard rectanglular arrays - matrix math, MIDI music, sudoku,...
Matthew W.'s user avatar
6 votes
4 answers
568 views

Effective ways of teaching regex to students who know Java

My students are knowledgeable about Java but need to know something about Regular Expressions. Many students find them difficult and intimidating. The students don't need to know every detail, but do ...
ItamarG3's user avatar
  • 6,312
6 votes
3 answers
211 views

Simple explanation of JPEG working principles

I will teach a lesson on image file formats in a computer science high school class. Regarding JPEG, I will say that it achieves lossy compression and that it is well suited for photographs but it ...
totera's user avatar
  • 435
6 votes
3 answers
168 views

"Computer sciency" and "practical" exercices involving dictionaries

I am teaching a course in data structures to a 2o semester. We hear often that the dictionary is a very versatile data structure, and solves quite so many problems. I'd like to illustrate that, but, ...
josinalvo's user avatar
  • 331
6 votes
5 answers
230 views

Quick and easy intro to computer science for kids for an Engineering Field Day

We have a large engineering day that hundreds of kids (ages 6-12) and their parents will attend. The setup is as follows: local engineering groups/societies will have stations and they will have ...
c_maker's user avatar
  • 161