Copilot

https://news.ycombinator.com/item?id=35471481

What’s wrong with using it for boilerplate ?

It costs 10$/month and probably saves me hours in stupid boilerplate, not just because it reduces typing but because the kind of typing it fixes is the boring stuff that gets me out of flow.

And boilerplate is a vague term, good example of copilot “AI” features :

function(a, b, c, d) { if(a …) { .. }

if(b // starts generalizing from a case but is very context aware

// here it's already doing c and d

}

and we can be talking about very non-trivial permutations here where it’s obvious from context what you want to do but generalizing to cover all cases would be more work than just writing it.

And tests - sometimes it can generate a correct test with mocks just from function name, sometimes it’s garbage - but it’s really easy to glance at which it is.

My current experience with copilot for ~2 months is that it’s really good at such boilerplate, it’s annoying when it’s late or fails at what I expect it but, and it makes generating boilerplate code very cheap so it can lead to a lot of duplication.

If you’re good enough you know to pick up when you should apply DRY and when not, you’ll get a feel when copilot is useful and it will be a decent productivity boost IMO. If they made it faster and more reliable (just for the cases I already use it for) I would pay >100$ month out of pocket for sure.

My favorite usage of it is when writing database migrations. I’ll write my up case and then it will write the down case for me. For migrations adding multiple columns, indexes, triggers, etc. it’s good about getting the right order for the down case and generating the right commands.

Is it writing meaningful code for me? Nah. Is it helpful? Certainly.

I’ve found it amazing when working in semi-familiar programming languages. I’m primarily a Ruby dev, but currently working in Python. The languages are close enough that it’s an easy transition, but they do a lot of fundamentals differently.

Previously, it’d be extremely disruptive to my thought-process to have to go lookup basic functions, like checking array lengths or running a regex on a string.

Now, I just write a comment like # check array length or # on x_var, run this regex "\s+". Copilot spits back what I need (or at least close enough to avoid having to break context).

Even in core languages, I’m finding it very useful for writing system calls or niche functionality that I don’t use frequently. My mental model knows what needs to be done, but I don’t remember the exact calls off the top of my head.

I actually still prefer SO as I get to see different solutions to the same problem and related discussion. Co-pilot is great for boilerplate stuff though, which is the majority of lines for most projects these days I’d guess.

If you like seeing options, you might be interested in having the Copilot pane open while you code if you are using it. It shows usually about 4 solutions in the panel that it is thinking about for autocomplete, and you can click which one you want.
ot necessarily better than SO but I find it nice to see options. 

I haven’t used Copilot recently, but I have been using Codium[0] which is similar. I find it often does a reasonably good job at completing similar structures in my own projects where I can’t imagine it has seen similar examples. It doesn’t always do a great job, but it does save me time.

[0] https://codeium.com/

I migrated from copilot to codeium as I found it much faster and just as smart. Not sure if the speedup comes from network latency (I'm in New Zealand) or actual model calculations. That was pre GPT4 though, and I'm willing to try copilot again soon.

I love C# and I used it extensively for a long time, but I think Copilot shines with JS/TS and Python because of the massive amount of code published in open source projects.

Not that I find it as useful as most people do, but there is a difference…

It’s also not that great with go, but surprisingly (to me) still better than C#.