13 September 2011

How to explain programming to young children

A recent article on Slashdot had an interesting comment titled Here's my way of explaining "programming" authored by "Sun" (or Shachar) [minor typos corrected]:

Caveat - I have never actually tried it, and I developed it for adults. I still think it might work with 2nd graders (probably too complex).
Ask for a volunteer. Write a bunch of numbers on the board, and tell the volunteer to sort them.
Explain that this is not programming.
Now, cover the volunteer's eyes, write some more numbers on the board, and tell him to tell you to sort them. Allow asking "what is the first number" and such.
Explain that this is, also, not programming.
Now, tell the volunteer to tell you how to sort the numbers before they are written on the board. Explain that once the numbers are written on the board, you will not hear any comment from him. Write the instructions down on the board. When they are done, write down numbers and carry the instructions out. Try to pick numbers that won't work with their instructions. Allow the class to fix the instructions, but any time they do, restart the whole thing.
This is programming.
Shachar

While I agree that it seems a bit involved for a 2nd grade classroom (where making a PB&J sandwich might be more appropriate), this seems like a good approach for middle school and up.

Technically, this is demonstrating how to create an algorithm, but creating an algorithm to solve a task is a big part of programming. Once the algorithm is done, the programmer must then implement it efficiently in a programming language.

A variant of this would be to pair up the students and give each group a set of cards to sort - cards should be a bit easier for the blindfolded student to work with. After each group has created their sorting algorithm, the algorithms can be shared with the class and you can run through examples to improve them collaboratively.

11 September 2011

K-8 curriculum overview for computer skills

From the If-I-Ran-The-World Dept...

So here is a rough outline of my ideal computer skills curriculum for K-8, with a focus on preparing students for programming in middle school. I'm assuming roughly 1.5-2 hours per week and ~32 weeks in a school year. For K-5, the items are more "computer literacy" than "computer science", but that changes in middle school (grades 6-8) where the focus switches to teaching how computers work and how to program.

Note that, when assigning a lesson to a grade/age, I tried to select a grade where the vast majority of students would be ready and able to understand the concepts. Thus, the grade-level specified is meant to be appropriate for a classroom setting.

When homeschooling or teaching an individual, you may find that the student is ready for this material at an earlier age (often 2-3 years earlier). The best learning environments are those that can adapt to the students' interests, so feel free to move things earlier as needed. But note that this request to move the lesson earlier needs to come from the student.

For classrooms, if you prefer to think in terms of Introduce/Reinforce/Master, then the grades listed here are a cross between Introduce and Reinforce.

I'm using US school grades so add 6 to get an approximate age (1st grade is roughly 7 yrs old).

Elementary School

The key lessons here are to learn how to use computers effectively and to be exposed to the underlying math/logic principles that will be used in middle school.

At the end of 5th grade, the students should have the following skills:
  • Know how to interact with a computer using mouse and keyboard
  • Be able to save/load files from an app, and to organize their files in directories
  • Understand non-decimal number systems, specifically binary numbers.
  • Understand basic boolean logic, specifically AND, OR, XOR and NOT
  • Have a general understanding of how things are stored on a computer
  • Be able to use a web browser and perform effective internet research
K - 2nd grade


During these years, the student should develop basic computer interaction skills.
  • Mouse: moving, pointing, clicking, selecting, double-clicking, dragging, ...
  • Keyboard: basic typing skills, 
  • Parts: name the various parts of a computer
3rd grade

Focus on using computers as tools.
  • Productivity apps: word processor, spreadsheet
  • Keyboard shortcuts for common operations: (cut/copy/paste/undo, find/search)
  • Understand file types: txt, doc, gif, png, mp3, avi, ...
  • Understand where files are stored: locally, on file server, in cloud
  • Maintaining an account: passwords, logging in/out, simple security
  • Web browser - using and navigating
4th grade

More work with using computers as tools, but start building the foundation for
computer lessons in later years.
  • Email - etiquette, subject lines, spam & chain-mail, attachments, privacy, To/Cc/Bcc
  • How to perform internet research. How to evaluate a website's reputable.
  • Ethics: copyright, fair use and giving appropriate credit
  • Web browser - uploading/downloading/sharing files
  • Security: viruses, worms, trojan horses
  • Security: passwords, privacy
  • Number systems: roman numerals, tally marks, zero
  • Number systems: positional number systems (decimal, octal, binary, hexadecimal)
  • Curriculum-Link (Math): number systems
  • Curriculum-Link (Math): plotting x-y values
5th grade

Less focus on how to use computers, and more focus on what's going on behind the
scenes.
  • How data is encoded on computers (text/char-sets/unicode, colors/rgb/hsl, digitizing analog/digital, audio, video, ...)
  • Compression/decompression of computer files (zip)
  • Security: encryption
  • Difference between text editors and word processors.
  • Privacy: browser history, cookies, caches
  • Privacy: what happens when personal info (or password) is comprimised
  • HTML/CSS: create a set of linked webpages (on local machine) using a text editor.
  • Learn how to structure a project with many (HTML/CSS) files.
  • Boolean logic: AND, OR, XOR, NOT
  • Curriculum-Link (Science): colors and light, additive/subtractive color models
  • Curriculum-Link (Math): prime numbers (encryption)
Middle School

During middle school, the students should be introduced to programming and learn how computers work. Optionally, they should learn about electronics and robotics (although these lessons tend to require extra equipment, so it's not always possible to include them).

At the end of 8th grade, students should:

  • Understand why computers use binary
  • Have been exposed to the "big ideas" that de-mystify how computers work:
    • How computers perform computation
    • How computers remember things
    • How computers perform actions in sequence
  • Know how to write simple programs in at least 2 different programming languages
  • Be able to construct a small electronic project on a breadboard

6th grade

In 6th grade, the students should be introduced to all the basic programming concepts: variables, flow control, functions, arrays, and so on.

  • Visual programming: Scratch or variant - variables, flow control
  • Choose two languages from: [Python, Javascript, Processing] - functions, arrays
  • Interact with the computer using the shell/cmd-prompt
  • Wildcards and simple regular expressions
  • Internet: How the internet works (to route traffic, overview of DNS)
  • Privacy: where your internet 'footsteps' are logged (routers, ISPs)
  • Security: botnets and why you should apply security patches
  • Algorithms: searching, sorting
  • Curriculum-Link (Science): Write spreadsheet functions for data analysis

7th grade

Continue building programming skills by expanding into more languages. Introduce basic electronics and explain how computers work.

  • Choose remaining language from: [Python, Javascript, Processing]
  • Electricity: very simplified - focus on Voltage - just enough to understand transistors
  • Transistors: what they are and how they work (CMOS)
  • Logic gates: built from transistors (NOT, NAND, NOR)
  • How computers calculate (addition using logic gates)
  • How computers remember (memory latches using logic gates)
  • Negative numbers in binary (2's complement)
  • Basic digital electronics with Arduino (breadboards, LEDs, servos, ...)
  • Optional: Robotics (if you have the resources)
  • Curriculum-Link (Science): Electricity (done properly with V=IR, ...)

8th grade

More advanced programming and managing larger projects.

  • Java (using Greenfoot or BlueJ)
  • Do at least one "large" programming project
  • Project management: divide large task in to smaller subtasks
  • How memory is allocated (stacks, heaps, fragmentation)
  • How functions are called (call stack, recursion)
  • Data encapsulation, classes and inheritance
  • Regular expressions: grouping and matching, greedy vs. non-greedy
  • Floating-point numbers: representation and implication for scientific calculations
  • More data structures and algorithms: stacks, linked lists, hash-tables, trees, graphs, ...
  • Curriculum-Link (Math): Trigonometry
  • Curriculum-Link (Science): Using regexps to process data files
  • Curriculum-Link (Science): Gravity, acceleration (for jumping in a game)