Non-programmers intro to AI for programmers

post by Dustin · 2022-04-05T18:12:08.337Z · LW · GW · 0 comments

Contents

No comments

It occurs to me a lot of people are interested in AI but aren't programmers themselves.

This quick post describes using an AI helper called Github CoPilot. It will do so via a short scenario wherein CoPilot helps me write a bit of code. It will be almost completely non-technical (or, at least, as non-technical as is possible). The aim is to describe the experience and practicalities of using this technology.

Since this is aimed at non-programmers, a piece of background information is in order:

Programming is mostly not about remembering how to do specific things.  It's more about knowing how systems work so you know what to look up when you want to do some specific thing. (Of course, the more you do a specific thing, the remembering comes along.)

On to the scenario...

Say I need to write some code to check if some content on a web page is larger than it's container on a web page. You've seen this before when some content on a page has its own scroll bars in addition to the main scroll bar on the side of your browser.

I've done this kind of check before, and I know how web browsers work, and I know basic logic. However, I don't remember off-hand the specific ways to access the information I need.

A piece of code that would tell me if some content was bigger than it's container might be called isOverflowing, so let's try that:

isOverflowing demo

(Don't worry, you don't really have to read or understand any of that if you don't want to. Again, we're just describing the experience.)

The green text that appears is what CoPilot is suggesting I use as the code for the function...and it's exactly what I want. I know it is what I want because it prompts my memory for things I already knew. So, I pressed Tab and the suggested code became real code in my editor.

This is one of the benefits I get out of CoPilot: I don't have to go searching on the web for the names of the information I need, CoPilot just knows them for me. Here it probably saved me 5-10 minutes of Googlin'.

In this instance, as soon as I saw them, I remembered that scrollHeight, clientHeight, etc. are the right tools for the job I needed done. However, if I was less familiar with what I needed, I would hit up documentation and/or Google to make sure this code was correct because sometimes what I want and what CoPilot thinks I want don't match up.

CoPilot helps with other types of problems as well:

I'll try to come up with some demos of the previous points if anyone is interested.

I think CoPilot saves me time, but a person also has to be vigilant. It can suggest code that looks good at first glance, but does the opposite of what you want or doesn't work at all or has security vulnerabilities.

0 comments

Comments sorted by top scores.