DEV Community

Discussion on: Github copilot is out of beta, would you use it ?

Collapse
 
ncpa0cpl profile image
ncpa0cpl

I was excited about Copilot, but now that I tried it I am just very disappointed.

I didn't spent that much time with it but so far it's been very difficult to have it suggest anything useful.

Here are some of the attempts I made with it:

  • I've tried to generate some simple React component, it suggested to me only one line, an import from a library, and then after selecting that suggestion, for the next line it would once again suggest the exact same thing, if I selected that, it would suggest it again, and so on, I was stuck in a never-ending loop
  • in other attempt it would start with something that actually looked like a React functional component but then keep suggesting the same exact useState over an over but with longer and longer names. In the end I wasn't even able to generate any valid React code.
  • I asked copilot to implement a mutex, and what I got was either a simple class with a single boolean attribute and lock/unlock functions wchich were setting that boolean to true or false, or something that actually made no sense at all.

Also in all the attempts I made there was only one or two suggestions available to chose from.

In the end I don't think I will be using it much if at all, since how it was performing so far I would probably waste more time trying to make it give me something useful than if I just wrote that code myself.

Collapse
 
fish1 profile image
Jacob Enders • Edited

I found that Copilot was much more helpful when you write 'companion' code.

Take for example, you're writing two functions to make a GET and a POST request to an API. When you write the first GET request, it knows nothing about the API you're using or how you might want to use it. So you essentially need to write it yourself.

But then when you need to go and write the POST, it has the GET call as an example. Now it knows about the API and vaguely how you are going to be making the calls. You can almost tab complete the entire thing and just make a couple of changes to the parameters.

I found that using COPILOT with this mindset really takes advantage of its learning ability. It does pattern recognition, not mind reading.