Noah Brier | December 29, 2022

The Code x AI Edition

On code, partnerships with AI, and how our tools shape us.

I published this yesterday on my BrXnd.ai newsletter all about the world at the intersection of marketing, AI, and creativity. Subscribe if that’s of interest.

Noah here. On my mind this week has been code. Specifically, GitHub Copilot. If you aren’t familiar with Copilot, it’s Github’s AI assistant, which utilizes Open AI Codex. It integrates as a plugin with VSCode, Microsoft’s incredibly powerful open-source code editor, and just like Gmail’s recommendations, it suggests autocompletes in real time. Unlike Gmail, the recommendations are amazing. Not only are they generally good code, but they’re also specific to the codebase you’re working within. That means it gets to know the specific API or variable names you’re working with and recommends based on those context clues.

Here’s a real example from a project I’m working on.

It’s pretty amazing. Sure, it makes some stupid mistakes sometimes, but generally, it’s right on and particularly useful for remembering syntax and for writing API code. The former is directly competitive with something like StackOverflow, which is where I used to find answers to my dumb little syntax questions. The latter, on the other hand, is pretty directly competitive with engineers themselves. It’s not surprising that something like Copilot would excel at writing API code. After all, APIs are all documented—most of them by the code itself—and therefore pretty easy for a computer to make sense of. Here’s an example of Copilot writing some API code for Remove.bg, an AI service that can remove backgrounds from images.

Connecting APIs is a huge, time-consuming, and often annoying part of writing code, and it’s interesting to think about the implications of a system like this being particularly good at that problem.

Why is this interesting?

Most fascinating to me, however, is how I’ve found myself subtly (and not so subtly) changing my own behavior to work better with Copilot. It’s real “we shape our tools, and thereafter our tools shape us” stuff. One thing I’ve been doing is writing far more descriptive variable names. That’s a generally good practice, but it’s particularly useful when partnering with an AI, as it gives the system some more context clues to work with. In the example above, I strongly suspect calling it removeBgResponse helped it make sense of the rest of the fetch call I was making.

The other thing I’ve been doing is blocking out my code with comments. The impact of that is that sometimes Copilot will actually offer me all the code I need to make it work. Here’s a toy example of calling Contentful, a headless CMS. You can see the clear impact of writing some comments. I have no Contentful code in the codebase I was recording this in, so it was working purely off the name of the file and the comments I added. Pretty amazing stuff. (NRB)

Thanks for reading,

Noah (NRB) & Colin (CJN)

Why is this interesting? is a daily email from Noah Brier & Colin Nagy (and friends!) about interesting things. If you’ve enjoyed this edition, please consider forwarding it to a friend. If you’re reading it for the first time, consider subscribing.

© WITI Industries, LLC.