A Beginner's First Code Editor Shouldn't Have AI

This post was originally published on blog.charliemeyer.co

For many of our student users, Pickcode is the first piece of software they’ll use to write code (excluding stuff like Scratch). The goal of this post is to explain why our product should not contain an AI copilot/assistant/autocomplete etc.

I think it is extremely easy to make a hand wavy, half baked analogy to some other field to make this argument. Long time readers of this blog may be aware that I’m a big fan of hand wavy, half baked analogies. But today, let’s be practical.

What is a code editor

A code editor is a program where you type in letters and symbols in the hopes of creating a new piece of working software. Many code editors, including Pickcode, include a built-in mechanism for running the code that you type. For example, you could type this Python code into the Pickcode editor, press the big green button, and see the number 7 in the console.

print(5 + 2)

Typing code into an editor and pressing the equivalent of “the big green button” is one of the key skills required to develop software of any kind.

What is an AI copilot

An AI copilot in a code editor is meant to do a lot of the typing for you, based on its training on publicly available code.

For example, you could create the following program:

print(“welcome to the area of rectangle calculator”)
side1 = int(input(“enter side 1 length”))
side2 = int(input(“enter side 2 length”))
print(“The area is:”)

As you’re about to type the last line, a good copilot will suggest that you type print(side1 * side2). Nice!

When I'm writing code with Github Copilot, this feels like magic. These sorts of little wins happen all the time. Sometimes, Copilot will even successfully suggest larger snippets that save me the trouble of looking up how to open a csv file, create a bar chart, or any number of small tasks.

At this point, it’s a bit of old news, but Copilot also messes up. Unless I’m really asleep at the wheel, I’ll usually catch a mistake, hit undo, and type whatever code I need by myself.

This is no small issue – any one problem in code can be the difference between functioning software and a pile of errors. Some napkin math tells us that if your AI writes a sufficiently good line of code 99% of the time, and your file contains 50 lines, you have a .99 ^ 50 = ~60% chance of having a functioning program.

So we are faced with the following constraints for our student who wants to learn to create software.

They need:

  • A place to write their code (a code editor)
  • A way to develop the skill of identifying incorrect code (needed regardless of the presence of AI)

The vast majority of the student’s progress in learning about programming will take place in the code editor. If that editor contains an untrustworthy autocomplete mechanism, when will they learn when to trust the autocomplete? We need to break the cycle here, which means we need an AI-free starting place in which students can develop a basic proficiency in programming. I don’t think anyone knows how long the AI-free development phase should be, but for now let’s put in a placeholder of 1 year.

The good news is, unlike everyone who learned to code before the 2020s, a student’s coding career after year 1 will require a lot less typing.

So as to not sound like a luddite, here are some AI related ideas that we actually might build:

  • Copilot for teachers generating programming exercises - I already do this myself, I think this could be a big win.
  • AI “explain this code” feature - Taking structured code and expanding it into natural language is much easier than the reverse.
  • AI for reading documentation - If a student wants to make a game in Python, they’ll probably need to do some research into graphics and a number of other technologies. Documentation is hard for beginners to read, and AI can probably help here.
  • AI tutor - Meh. It’s a very fine line between giving away the answer and being extremely frustratingly unhelpful. Navigating those lines is the essence of the art of teaching, and I don’t think that’s very easy to automate!

Read more