How I Teach Java to Absolute Beginners

I have been teaching beginners to code for the better part of two decades. Most of my students have literally no experience with code and no special aptitude for it; these are public high school students, not computer science majors at some fancy university.

I have a couple hundred assignments on my class web page from day 1. Each assignment is worth points based on its difficulty. Students read my textbook or watch videos to learn and earn points for each assignment completed. Their grade for the cycle is based on the total number of points earned.

For background, I teach at Leander High School, a rural-turned-suburban school near Austin, TX. Depending on the year, I have between 80 and 110 students in three or four sections of my intro "pre-AP" Computer Science I course. My classes are as racially diverse as the Austin area and about 25% female. My class is an elective and students who are advanced in math can take it as early as 9th grade, so my students range in age from 14 years old up to 18.

However, I should make clear that this essay is my personal opinion and that I am not speaking in any official capacity for Leander High School or Leander I.S.D..

Before I get started, here's a quote from one of my former students that now works at a major tech company in the Bay Area:

“This is basically the holy grail of teaching:It really is too bad that more types of classes aren't taught this way.”

The Back Story

In June 2010 I wasn't happy with how my intro course was going. I was teaching in the traditional way with lectures and assignments, and the students got a few days to work on the practice assignments before we all had to move on.

At the end of the year, I had frustrated kids that couldn't do any of the assignments because they had too many gaps. On the other hand, my fastest kids were happy enough but had a lot of days in class with nothing to do.

There was one student in particular who pushed me over the edge. Let's call him Archie. Archie was a good kid who had earned a B+ in the first grading cycle. There were a few things he hadn't learned properly at the beginning of the year and maybe a couple of things he hadn't learned at all, but his grade was fine so he didn't worry about it. He got Bs in a lot of his classes, after all.

During the second grading cycle he repeated his feat: earning roughly a B. Missing certain concepts. There were some trouble spots lurking but he didn't know it. He was building on a bad foundation and neither he nor I knew it.

By the third cycle Archie's grade started to dip. When you don't quite understand how variables work, then if statements are going to be a struggle. With a fuzzy understanding of those, for loops are nearly impossible.

He started coming in after school for extra help. I started to realize how little he understood. But at this point, what can be done? He's slower to understand the concepts than the other students which is why he has fallen behind. Should I create a whole bunch of extra assignments to let him practice? At this point, there are about ten weeks' worth of material he should probably redo. How is he going to relearn a couple of months of computer science while still trying to learn the new material?

A routine emerged. He would come in after class each day and try to get some extra time. I would address his confusion as well as I could. He would eventually get his assignments "working", but he didn't really understand why the code worked, only that it was "good enough". By the end of the year, he squeaked by with a flat 70%, but both he and I knew that he couldn't have coded anything from scratch by himself.

Once the year ended, I knew that I couldn't in good conscience continue teaching this way.

The Flip

Over the summer of 2010, I dug out every decent assignment I had ever created and even some of the less-good ones and put them on my teacher website. I used my gut to assign point values to each assignment based on its relative difficulty.

The next year I started as I usually do. After a day or two explaining computer science and my expectations, I always spend a day having them meticulously copy a "Hello, World!" program in Java. They type it up in Notepad, save it to a particular location, then open Powershell to navigate to the correct folder and compile it on the command-line using javac.

(This takes forever. Maybe two hours over two class periods. My students have never done anything like it before and not everyone has a fantastic eye for detail or complex lists of instructions.)

Finally, they all have a working program. They turn it in. Then, that fateful August in 2010, I showed them the list of assignments and turned them loose.

"You can work on any assignment in any order and turn it in whenever. Once an assignment is perfect, you'll receive the specified number of points. At the end of the grading cycle, your grade will be based on how many points you have."

I then spent the next week circulating around the room, gently and non-judgmentally showing each kid over and over again how to type up the sample code, how to save it, how to compile it from the command line. The process was excruciatingly slow at first but they began to pick up speed. In a month, they were flying.

So since then, my classroom has been "flipped" and self-paced. The students work through my curriculum at their own speed and I virtually never lecture; I just circulate around the room helping the kids.

In order to fill in some gaps in my materials, I wrote Learn Java the Hard Way in the summer of 2013. The book is 240 pages of example code, explanations and challenges, and includes about 10 hours of video where I walk readers through the concepts in each chapter. Now my students read a chapter from my book and do the Study Drills, then go back to doing several more assignments from my sequence to practice.

(I do sell the books to others online, but not to faculty, staff, or students at any Leander ISD school. The book is doing just fine; I have no desire to make money off my students or coworkers.)

The System

My basic class flow now looks this:

Students begin the year with zero points and earn points by completing lab assignments at their own pace. Their grade is based on how many points they earn before the last day of the grading cycle. (example: 600 points = 100%, 415 points = 90%, 265 points = 80%, 150 points = 70%). Points carry over to future cycles, so the grade in cycle 3 is based on the total number of points completed all year, not just the points earned in the 3rd Six-Weeks.

All class assignments (except pop quizzes) are available on the class website from day 1, with point values for each ranging from 5 to 300 points, depending on difficulty.

I have put together an example page with most of my assignments and the point thresholds for various scores.

As far as late work goes, there is no concept of "lateness". Any assignment may be turned in for full points at any time. The grade for a cycle is based on the total number of points submitted/graded by the final day of the grading cycle. Any work turned in after the last day of a grading cycle will count as points toward the following cycle.

Any assignment that did not receive full credit may be fixed and turned in at any time for full credit. The new grade entirely replaces the previous grade. The only exceptions are in-class pop quizzes and semester exams, which may not be retaken. Any assignment that wasn't perfect will have comments explaining what wasn’t right. Students can often fix the assignment with just these as a guide, but if not they should ask me in class and I'll tutor them through it. They can also use my book, of course, or watch my tutorial videos in class or from home.

As far as cheating goes, I can usually tell when a student turns in work they didn't create because I have spent time with them in class and I know what they're capable of.

Anyway, that’s the basics of it. I'm incredibly happy with how my pre-AP class goes now. Even my slowest students end of the year knowing how to do something and my fastest kids really learn a lot.

-- Graham Mitchell, originally published 17 September 2016