2023-02-09

Tab Complete your way to Greatness

You know the code you want to write, but you just can’t seem get it out. You’re unfamiliar with the library you’re using, but you roughly know what it’s suppose to do. Maybe you’re programming in a new language. We’ve all been there. It’s what’s preventing you from busting through the resistance and getting where you want to go.

You remember the days of when you started programming. You didn’t know any better. You Googled, copied code, tried it, got an error, and tried again. You’re so much smarter than back then, what’s stopping you? Is it your big brain that is getting in the way?

The good news is our AI overlords are here. You don’t have to know anymore. Type in a comment, invoke Copilot, cycle through some suggestions, edit it to be correct, and move on. Seriously, if you haven’t tried Copilot you’re missing out.

I recently picked up Elixir. I had watched all the conference talks. I knew all the high level ideas of what makes the language great, and roughly what it looks like in practice. Yet, it wasn’t Python. You see I know the Python standard library inside out. I’ve been using it for the last 12 years. When it came to implementing something in Elixir, however, I’d struggle with remembering functions and syntax. I’d lose my attention before I could get that first dopamine hit of seeing working code. I had so many false starts. Then I installed Copilot.

This thing is amazing, It fills in the syntax where I only remember the concept. A Phoenix form needs a Changeset, which you pass through your Context to your Ecto Repo to execute. Sure I remember that, but what gets passed into what exactly? How do I create a changeset? What’s the Ecto DSL for incrementing a counter again? Just put your cursor where you know the code should go, and Copilot will autocomplete the rest.

At it’s best, on an empty line, Copilot just writes the correct code. At its worst, I have to write a comment and cycle through two to three suggestions. Furthermore, modern NeoVIM (and VSCode) have deep language server integration, so when it does produce incorrect code, the compiler, linter, or type system can catch the errors and give me a sensible enough error message that I can fix it.

Coding these days feels more like mediating a conversation between your Type System and Copilot.

I’ve never experienced something quite like it. The implications of this are going to be big.