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
89
votes
26answers
26k 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 ...
64
votes
21answers
15k 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, ...
51
votes
13answers
8k 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 ...
39
votes
20answers
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 ...
33
votes
13answers
3k 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 ...
32
votes
7answers
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 ...
26
votes
13answers
3k 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 ...
18
votes
6answers
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 ...
16
votes
8answers
4k views

Demonstrating the possible dangers of SQL injection

Students building websites in a high-school computer science major (using HTML, javascript, ...
15
votes
9answers
852 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 ...
15
votes
8answers
594 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 ...
15
votes
3answers
528 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 ...
14
votes
11answers
610 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 ...
14
votes
10answers
3k 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, ...
11
votes
13answers
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 ...
11
votes
8answers
431 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 ...
10
votes
5answers
469 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 ...
10
votes
6answers
328 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 ...
10
votes
6answers
422 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 ...
10
votes
4answers
657 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 ...
10
votes
5answers
1k 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 ...
10
votes
2answers
136 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 ...
9
votes
10answers
1k 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 ...
9
votes
7answers
740 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 ...
9
votes
5answers
820 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 ...
9
votes
4answers
273 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 ...
8
votes
11answers
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 ...
8
votes
7answers
375 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 ...
8
votes
5answers
717 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: ...
8
votes
6answers
231 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. ...
8
votes
3answers
285 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 ...
8
votes
2answers
121 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/...
7
votes
8answers
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 ...
7
votes
5answers
172 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 ...
7
votes
3answers
181 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 ...
7
votes
4answers
182 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 ...
7
votes
2answers
272 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 ...
7
votes
1answer
221 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 ...
6
votes
4answers
665 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 ...
6
votes
4answers
402 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 ...
6
votes
3answers
171 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 ...
6
votes
2answers
269 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 ...
6
votes
5answers
372 views

Explaining how the Internet and the World Wide Web work

I have been having trouble finding a good resource (ideally a video) or analogy that helps me to explain how the Internet and the World Wide Web work. It does not need to be too in-depth. Only enough ...
6
votes
1answer
178 views

Lab ideas for information theory

This question is somewhat related to a prior question that I asked about an Information Theory lab. I received a lot of great feedback there, but I have not gotten past the idea yet that the lab that ...
5
votes
5answers
345 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,...
5
votes
2answers
228 views

Introducing A* Search Algorithm

I created a group lab where one student makes a random maze generator, one student makes a corresponding maze solver, and the last student calls the methods created by both students and creates an ...
5
votes
2answers
117 views

Assignment repositories

Are there any assignment repositories that you use for assignment ideas? I am aware of the Nifty Assignments from Stanford and have used several. There are a lot of good fine grained problems on ...
5
votes
3answers
133 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, ...
5
votes
3answers
204 views

Short foundational lessons for 7-8 year olds

I have an opportunity to run four classes of about half an hour, with 7 to 8 year olds (my sons age). This is part of a program called STEM professionals in schools. All I am there to do really is ...
5
votes
4answers
126 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 ...