What learn-to-code websites can teach us about the future of education

I’ve spent most of my life in school. Mostly as a student but occasionally as a TA or prof. Since finishing my PhD this year and striking out into the private sector, I’ve done a little work to beef up my technical skills. I went on one of those learn-to-code websites to practice writing SQL queries, which I haven’t had to use for several years.

I’m not exaggerating when I say that those free websites are already much better at teaching than any university course. And it’s not even close.

But why? Why is traditional classroom pedagogy falling behind online tools? And what can schools learn from this?

Let’s start by recognizing what learn-to-code websites do right. I used one called HackerRank because a job I was applying for used it to screen candidates. To learn SQL on HackerRank, the website presents you with a series of problems. The problem might be something like “query the People table and return a list of all the first and last names of unique individuals over the age of 40, sorted in reverse alphabetical order by last name.”

Then there’s an input box where you can write code. You can compile the code, see the output, and be told in seconds whether your query returned the correct output. If you got the wrong answer, you can try again as many times as you want until you get it right. If you’re having trouble, there are materials to help you learn what you need to know (though I eschewed these in favour of Google in another window). Once you solve the problem correctly, you move on to the next question, rinse and repeat until you’ve learned a ton of SQL.

Now imagine that, instead of learning SQL or any computer-based task, you were learning some other subject. Let’s say you’re learning linear algebra and you’ve paid thousands of dollars to learn it in a university course.

You would attend two 80-minute lectures a week where a professor would tell you about linear algebra. You’d pay close attention for the first half hour but lose focus thereafter because human brains are not optimized for 80-minute lectures.

You’d buy an expensive textbook, and the prof would assign a handful of questions from it once every week or two. You would attempt to answer the questions, hand in your answers, then wait up to a week to find out if your answers were correct. Prior to the midterm and final exams, you would study by reading the textbook and trying out problems, consulting the answer key to see if you were getting them right. Then a small subset of the subjects covered in the course would appear on the exam, you’d get them right or wrong, and you probably wouldn’t even look to see what questions you got wrong on the final. You’d just check the final grade and move on because there’s no point in studying after the course is already over.

Thinking back to my many years in school, I learned the most when I was working through a series of problems with the answer key nearby so I could reference it immediately when I solved a problem or got stuck. That’s when I had the tightest feedback loop between attempt and feedback. But that feedback loop isn’t built into traditional education. It’s something I did myself as a study strategy. Traditional education is built around a glacially slow feedback loop wherein students are assigned problems to solve, they attempt to solve those problems, hand them in, the prof or TA grades them, and a few days later return them to the students.

There’s no pedagogical reason for slow feedback. A tighter feedback loop accelerates the learning process. The reason traditional schools give slow and limited feedback is that the professor and TAs’ time is a scarce resource. Learn-to-code websites can give real-time feedback because your code is graded by a computer, and computing is cheap.

I think that the learn-to-code websites show us what education ideally should look like in a future where computers can give instantaneous feedback on every topic. One day GPT-4, -5, or 6 will be able to grade any essay, word problem, and even drawings and video. (Heck, the Xbox Kinect was able to grade players on their dancing skills way back in 2010!) And once AIs can evaluate anything, there won’t be any reason to do school the way we do it now.

For instance, why do exams work the way they do? The idea is that the students try to learn the course materials, and then their professors use the exam to take a random sample of their course-related knowledge. Then students are assigned a grade based on how much of the sample they knew on exam day. This makes perfect sense given that the professor or TA has to grade every exam. They can’t test 100% of the course materials because that would entail too much grading. They can’t give do-overs for students who learned more after the exam because that would entail even more grading.

Learn-to-code websites test students on 100% of the skills they teach, and they give infinite do-overs until students have learned all of the material. This is how school should work when computers grade everything. When you think about it, it’s kind of messed up that you can understand 87% of the material in a course, pass with an A, and then never review the other 13% that you got wrong. What if that’s the bit that makes the bridge collapse, huh? What then!?

Speaking of grades, how will we rank students if we give them infinite do-overs? Won’t they all just get 100%?

Yes, but stronger students will simply complete more material. Instead of everyone being taught the same amount of information but retaining different amounts of it, let people attempt to learn anything at any time. We make everyone learn at the same pace because that’s most convenient for teachers, not for students. Teachers want to lecture everyone at once and they want to grade the same assignment all at once because both activities economize on their time. A computer can deliver lessons at the user’s convenience and grade materials instantaneously when the user clicks “submit.” That allows for all the materials students might learn to be broken into small chunks and studied, mastered, and certified at any time.

One reason to do education this way, with instantaneous computer-generated feedback and infinite do-overs, is that it is simply a better way to learn. Another reason is that our current system is incredibly stressful for everyone involved. If you’ve ever been to school, you probably have those recurring dreams where you’ve got a surprise exam that you forgot to study for. Why are we traumatizing young children by putting them in this high-pressure environment for all of their formative years? I never feel the slightest bit of stress when I hit “submit” on a learn-to-code website. If it’s wrong, I just do it again. I can’t say the same about handing in a final exam.

It’s probably not possible to give people childhoods that are completely stress-free. Some people need to be pressured to learn for their own good. But we can give them flexibility and choice in what they learn and in what order, subject to some kind of minimum constraint to make sure everyone has some basic amount of knowledge necessary to function in society.

Schooling is a fundamentally conservative institution, not in the political sense but in the sense of being slow to change and adapt. To the extent that it changes at all, it does so at a glacial pace. But sometimes a transformative technology comes along that can shake up even the most conservative of institutions. I believe that transformative technology is AI, specifically AI that can grade and give feedback on all the things we want students to learn in school. Relatively dumb computers can already evaluate some things, like code. Consequently, people have built tools that can teach coding much more effectively than anything we see in traditional schooling. When the computers catch up with the rest of the curriculum, there will be some big changes to be made.