AI 2 min read

GitHub Copilot and the end of typing code by hand

I’ve been using GitHub Copilot for three days and I need to talk about it.

Copilot is an AI that sits inside your code editor and suggests completions. Not just the next word or the next line. Whole functions. Sometimes whole files. You start typing a function name and it fills in the body. You write a comment describing what you want and it writes the code underneath.

It’s built on OpenAI Codex, which is a descendant of GPT-3 fine-tuned on code. It was trained on billions of lines of public source code from GitHub. Every open source repo. Every Stack Overflow answer. Every tutorial. Every library. All of it compressed into a model that predicts what code comes next.

The experience is disorienting.

What it feels like

You start writing a function. You type def calculate_distance( and before you finish the parameter list, Copilot has suggested the complete function. Parameters, body, return statement. And it’s… right. Not always. But often enough that you stop and stare.

I wrote a comment: “Sort a list of objects by their ‘created_at’ field, most recent first.” Copilot wrote the one-liner underneath. Correct. Idiomatic Python. Better than what I would have written, actually, because it used a lambda expression that I would have had to look up.

I wrote another comment: “Fetch data from the API, handle pagination, collect all results.” Copilot wrote a while loop with a page counter and a break condition. It even added error handling for rate limits. I didn’t ask for that. It just… knew.

The GitHub blog says Copilot is right about 43% of the time on first suggestion and 57% within the first 10 suggestions. That sounds low until you’re in the flow and realize you’re accepting suggestions faster than you could type the code yourself.

The pair programming analogy

The closest analogy I have is pair programming with someone who has read every open source repository on Earth but has no judgment.

Copilot knows patterns. It knows how APIs are typically called. It knows common data structures. It knows the idioms of the language you’re writing in. If the problem you’re solving resembles a problem that exists in public code somewhere, Copilot will suggest a solution.

But it doesn’t understand the problem. It doesn’t know what your application does. It doesn’t know why you’re building it. It can write a function that sorts a list, but it can’t tell you whether sorting is the right approach.

I caught it suggesting code that was syntactically perfect and logically wrong. A function that calculated a result correctly for the test case I was thinking about but would fail catastrophically on edge cases. It looked right. It felt right. It would have passed a quick glance.

And that’s the danger. When the suggestions are wrong, they’re wrong in a way that’s hard to catch because they look so right.

What this changes

I’ve been programming for years. I spend a significant portion of my coding time on what I’d call “mechanical” work: writing boilerplate, looking up API syntax, implementing patterns I’ve implemented dozens of times before. The thinking work, the architecture, the design decisions, the debugging, that’s maybe 30% of the time.

Copilot eats the mechanical work. It doesn’t touch the thinking work.

For now, that makes it a productivity tool. A good one. Maybe a great one. But a tool. Like autocomplete for email, but for code.

The question I keep asking myself is: what happens when it starts eating the thinking work too? When it can not just complete a function but design an architecture? When it can not just suggest code but suggest approaches?

I wrote about GPT-3 writing code a year ago and said I had feelings about it. Those feelings haven’t resolved. They’ve intensified. Because GPT-3 was a demo. Copilot is a product. In my editor. Every day. Changing how I work.

The licensing question

There’s a conversation happening about whether Copilot’s training data creates licensing issues. It was trained on public code, including code under GPL and other copyleft licenses. If Copilot suggests code that’s essentially a copy of GPL code, does that mean my project is now GPL?

Nobody knows. The legal frameworks haven’t caught up. I suspect this will be litigated.

What I feel

Three days in, here’s what I feel.

Relief, mostly. The boring parts of coding are getting automated. I can focus on the interesting parts.

Unease, a little. The speed at which AI is moving from “can’t write code” to “writes code in my editor in real time” is faster than I expected.

And wonder. The same wonder I feel watching rockets land and robots walk. A machine learned to program by reading our code. It’s not as good as us. Not yet. But it’s in the room now.

And it’s learning fast.


Related thinking:

a

astro

Thinking about AI, robots, space, and the future. Writing it down so I don't forget.