Hacker News new | ask | show | jobs
by cube2222 1465 days ago
I've been using Copilot for a few months and...

Yeah, it makes mistakes, sometimes it shows you i.e. the most common way to do something, even if that way has a bug in it.

Yes, sometimes it writes a complete blunder.

And yes again, sometimes there are very subtle logical mistakes in the code it proposes.

But overall? It's been great! Definitely worth the 10 bucks a month (especially with a developer salary). :insert shut up and take my money gif:

It's excellent for quickly writing slightly repetitive test cases; it's great as an autocomplete on steroids that completes entire lines + fills in all arguments, instead of just a single identifier; it's great for quickly writing nice contextual error messages (especially useful for Go developers and the constant errors.Wrap, Copilot is really good at writing meaningful error messages there); and it's also great for technical documentation, as it's able to autocomplete markdown (and it does it surprisingly well).

Overall, I definitely wouldn't want to go back to writing code without it. It just takes care of most of the mundane and obvious code for you, so you can take care of the interesting bits. It's like having the stereotypical "intern" as an associate built-in to your editor.

And sometimes, fairly rarely, but it happens, it's just surprising how good of a suggestion it can make.

It's also ridiculously flexible. When I start writing graphs in ASCII (cause I'm just quickly writing something down in a scratch file) it'll actually understand what I'm doing and start autocompleting textual nodes in that ASCII graph.

2 comments

100%

The thing ive most enjoyed is that it forces me to write out what I want to do in english before getting stuck in the weeds of how the code ought to work.

I've found if I explain the whole program ahead of time (the other day I wrote some python that converted the local time to display on a 13x13 grid of LEDs) co-pilot can write 90% of the code without me, just translating my explanation into python.

I thinking knowing how to express yourself to AI will be a unique skillset akin to being "good at googling"

> co-pilot can write 90% of the code without me, just translating my explanation into python.

I fear copilot may encourage these type of pseudo-code comments. The most valuable thing the AI doesn't know is WHY the code should do what it does.

Months later, we'll get to debug code that "nobody" wrote and find no hints of why it should behave that way, only comments stating what the code also says.

Seems we're replacing programming for reverse engineering generated code.

I can understand where you're coming from, but if a developer commits auto-pilot code without understanding it, that's not really auto-pilot's fault.

That dev could have done the exact same thing with stack over flow snippets. And create the same situation.

Sure its easier to make mistakes when copilot suggestions are so readily available, but its just a tool that needs to be wielded properly as any other.

It feels like an evolution of your typical IDE niceties that modify characters as you type.

I still remember when people were worried autocomplete would lead to code mistakes and variable mix-ups.

Now the one argument against this is if we become shielded from the full input and outputs of a tool.

It would work bad, but you could have a "copilot(code_fragment, args, ...)" that makes an executes a snippet blindly, hoping it's correct. That's when it stops being a hammer and starts being a boss looking over your shoulder and telling you what to do.

Fortunately, I think we have a while before AI can reliably spit out useful AST programs. But it could happen eventually.

hm, that is a conundrum to debug code nobody wrote

on the other hand, if an improved AI comes out in a couple of years, we can feed it the same pseudo-code and enjoy an improved output.

I would rather have a docstring explaining what the code should be doing

I've had co-pilot write its own comments too, my favorite one was, "this is a kind of a hack but it works", very professional indeed!

> It's excellent for quickly writing slightly repetitive test cases;

Ever considered parameterization?

Then you have harder to reason about test that can fail in its complex parameter matrix. I think it's okay for test to be a little bit repetitive
> Then you have harder to reason about test that can fail in its complex parameter matrix.

Can you give an example of tests that would be better with repetition than parameterization?

Yes, it writes the different cases out for you. The arguments...