Teaching Students to Code - What Works
8th grade students programming as a group on their class field trip to Hunter Industries

Teaching Students to Code - What Works

TL;DR - We must train our school teachers to teach our kids to code

For the past 10 years, I've been involved in the ever-growing effort to improve awareness and education for students learning to code. During this time I've personally taught thousands of students to code around the world via courseware built by my own non-profit TKP and earlier for Microsoft Digigirlz. I've also worked with volunteer teams from the US and many other countries to create coding courseware for events and for the classroom.

Lately I find myself involved in a number of large-scale efforts to address the lack of usable and useful resources for classroom teachers. To that end I wanted to share a summary of my findings and recommendations in this article.

Start in Kindergarten

Leaders of our industry, such as Alan Kay, have demonstrated for many years that children can learn complex (computational) concepts via visual learning before learning text or language-based computing. The natural mix of art (drawing, designing, coloring, etc...) and logic (controlling, moving, driving) come into play here.

Microsoft Kodu

For example, I have used Microsoft Kodu with this age group. I created a course on Linked In Learning for Kodu. Via the the creation of worlds and conversations between characters, kids can use the "when/do" construct in Kodu to add interactivity to their world. Working with the when/do programming screens flexes kids logical thinking muscles. There is a good-sized teacher community using Kodu. Here are some resources.

There are many other resources for this age group - Scratch, in particular is becoming pervasive. Also there are a large number of teacher-training resources at Code.org.

Continue in Middle School

TKPJava

This key time is where I find the greatest lack of resources. This is why I chose to focus the efforts of the organization I lead, 'Teaching Kids Programming', to create materials designed specifically for middle school teachers. We've created a full-year's set of TKPJava lessons and instructor-led courseware for kids ages 12+. Our work is based on the Turtle/Logo work of Seymour Papert and the book 'Turtle Geometry'.

We implemented a simplified (Turtle) API to introduce kids to Java. This scaled language-based coding approach is available in many coding languages. We selected Java because, if anything, this is what is offered in high school.

Other aspects of TKPJava include extensive code examples via Javadocs and careful leveling of API use via guided (one line of English comments is designed to be translated in one line of Java code and then run to verify correctness) instruction. To understand our approach to instructional design, read here. We pay strict attention to the order of concepts and also leveling within each set of concepts for each of the 8 TKP courses. This is shown in our course design pyramid below.

ACM magazine published an article entitled "Education: Is the US Education System Ready for CS for All?" In the article a Google-Gallup survey asked over 16,000 US-based students, parents, teachers and administrators questions about CS readiness. A key finding was this:

We asked principals and superintendents why they did not offer CS in their schools and districts. The most commonly cited barriers had to do with lack of qualified teachers...lack of qualified teachers was cited by 63% of principals and 74% of superintendents.
This indicates computing professionals can play an important role in expanding access to CS by supporting organizations that train teachers and by providing mentoring and resources to teachers and students.

TKPLabs trains CS Teachers

Because of the demand for teacher-training for coding courseware, TKP has spawned another non-profit, TKPLabs. They implement in-person, on-site teacher training in the TKPJava and TKPToT courseware. Lead trainers from TKPLabs have conducted teacher trainings in the US, Europe, Africa and in the Middle East.

Other Logo-languages

TKPJava is joined by a number of other Logo-like programming language APIs. Other examples of such Turtle-based learning are Turtle JS_ for javascript and Kids Ruby for ruby.

It is particularly important to provide an environment (preferably a browser-based IDE that will work on a Chromebook) that is designed for middle-school aged kids when introducing coding languages. An example of a well-designed IDE is Try Ruby (shown below).

Build in High School

AP Java is simply not enough. By high school, if students haven't had access to coding programs in K-8, many simply don't feel prepared to 'try' AP Java. For those that do try it, the experience is often miserable. I've personally tutored several students who 'wanted to drop this class as fast as possible.'

Based on connections to my teacher community, over 50% of the use of TKPJava is actually at the high school level. The reason is that this lack of 'bridge courseware' in middle school needs to be addressed somewhere if students do decide to pursue coding. For example, one of the teacher artifacts we provide (a slide deck which reviews core Java language concepts) that is particularly popular with high school CS Java teachers is shown below.

Code Koans

Yet another captivating way to learn a programming language is via puzzles. A great implementation of this is the Ruby Koans. The idea of a koan is a short code section (a method or function) that has a test condition. The learning comes in running the test, seeing the test fail and reading the error, then figuring out what code you need to write to get the test to pass. You then try to write some code, re-run the test, observe and learn from the output until you get the test to pass. After you get the test to pass, you reflect on what you learned in this process.

Crowd-curated code puzzles at Excercism.io

Another interesting project which has applicability in high school and beyond is the crowd-sourced code mentorship site Exercism.io. In this site you write the code to solve a puzzle (and make the tests pass, similar to the idea of Ruby Koans). You then submit your answer. Other users of the site can comment on your code solution AFTER they have submitted their own version.

You can also revise your answer and get additional feedback. This project is interesting because it allows students of any age to interact and also it includes a large number of both problems and also programming languages. This could be used to supplement existing CS HS coding courseware.

Below is an example of an answer I provided (in Java) to the question "Do the 'Transform' step of an 'Extract-Transform-Load' workload" and also the interface for code feedback.

import java.util.List;
import java.util.Map;
import java.util.stream.IntStream;
import java.util.*;

public class Etl {

	public Map<String, Integer> transform(Map<Integer, List<String>> inputList) {
    	Map<String, Integer> resultMap = new HashMap<String, Integer>();
    	inputList.keySet().iterator().forEachRemaining((key)-> {
    		inputList.get(key).stream().map(String::toLowerCase).forEach(item->{ 
    			resultMap.put(item, key);
    		});
    	});
        return resultMap;
    }
}

IoT Projects

In the past I've seen a number of efforts to improve HS CS courseware by adding coding projects. These were often creating web sites or creating mobile applications. While I applaud these efforts, I am seeing much more interest from students around programming IoT devices.

An example of a compelling programming environment, which also includes teacher resources around IoT is Microsoft's MakeCode. A sample program for an Adafruit IoT device, including the simulator, is shown below. MakeCode could also be used in middle school as it includes a block-based coding mode as well as TypeScript (a version of JavaScript) and C++.

Challenge in College

Our lack of connection between industry and universities is disappointing. Our graduates, even those who major in CS or Data Science, are not prepared to fill the ever-growing number of open jobs.

Preparing Students for Jobs

As a working Cloud Architect, I would like to encourage (prod, cajole...) the major cloud companies into increasing their programs for college students. I honestly find that AWS, Azure and GCP student programs do not go far enough to enable our students to learn and use the public cloud actively during their studies. Working in partnership with the major universities, we can address this problem of lack of trained graduates for many open jobs that I see everyday.

Training Future Teachers

In addition to learning and using coding to solve real-world problems, college students can also be trained as coding teachers to assist in middle and high school classes or events. Here's an example of my college-age daughter showing part of a lesson she created for a kid's event she taught at a technical conference in Norway (NDC Oslo).

Building a Comprehensive Path

I've summarized the student coding curriculum path that I see emerging in the grid shown below:

I view this as a blueprint for the change we need to lead in education.

Next Steps

What will our students build? How can we help them? I would be interested in your thoughts, challenges and successes in this area.

Marion Olmillo

Business Development | Talent Strategy

6y

Good article! In our school, we also start with visual / block programming such as Scratch in order to introduce the basics of progamming to young students. Then, move on to the actual introductory languages such as python and/or java.

Like
Reply
Purba Chakraborty

Asst Professor | Founder | Startup Mentor | Industry-Academia gap bridging | Skill development |Training

6y

Indeed this is a good initiative

Like
Reply
Hadeel M. Jawad, Ph.D.

Faculty member, School of Engineering and Computer Science, Oakland University

7y

Java is not an easy programming language for high schoolers . As application developer, I worked on two big projects with an Airline company using Java and spent a lot of time with this language but couldn't like it. It is surprising when you mentioned that students in APJava "wanted to drop this class as fast as possible". On the other hand, Block-based programming like the one offered by code.org or Scratch is more suitable for elementary and middle schoolers. High schoolers should write a code with a real programming language but Java is not a good beginning. JavaScript language is simpler and more suitable for school students to start programming with. The current offered courses inJava for high schools should be changed with JavaScript courses.

Like
Reply
Hadeel M. Jawad, Ph.D.

Faculty member, School of Engineering and Computer Science, Oakland University

7y

Current school teachers do not have the required skills for teaching computer programming . Programming is a language that required certain skills . Same as the French , Spanish or music teachers. As teaching music in schools provides jobs for music graduates , offering cs courses in schools will provide more jobs for computer science graduates especially women who can not work 9 to 5 . That's beside it's importance of providing the students with the skills needed in our information era.

To view or add a comment, sign in

Insights from the community

Explore topics