zlacker

[return to "GitHub Copilot available for JetBrains and Neovim"]
1. ipnon+V5[view] [source] 2021-10-27 18:11:22
>>orph+(OP)
Can any users give their opinion on how it's helping their productivity? What problems are they finding, if any?
◧◩
2. speedg+ld[view] [source] 2021-10-27 18:43:23
>>ipnon+V5
It does the boring code for me.

If I want to throw an exception if an object is null or undefined, Co-pilot will do the if and the exception throw using the right error class, and a more meaningful error message that what I usually came up with.

If want to map some random technical data table to something useful in my programming language, I can copy paste the data from the documentation in pdf or html into a comment block, give an example, and co-pilot will write everything in the format I want.

If I want to slightly refactor some code, I can do it once or twice and co-pilot can help me a lot to refactor the remaining.

If I want to have a quick http server in nodejs, I don't have to Google anything.

It's a lot of tiny things like this.

◧◩◪
3. TaupeR+1i[view] [source] 2021-10-27 19:05:07
>>speedg+ld
This is the kind of thing I would need to see in real time, because I simply can't believe that it does any of these things in a way that is reliable and doesn't involve having to search through and make sure it hasn't made any mistakes, taking just as much time as if you did it by hand.
◧◩◪◨
4. gfosco+1n[view] [source] 2021-10-27 19:28:57
>>TaupeR+1i
Likewise skeptical, but I have been super impressed with it. I just got in to the technical preview, and worked through a specific task I needed to do (involving mongoose, a mongo aggregate query, a few loops, some date functions) and started by adding a comment above each line. It helped a lot actually, felt like a collab.

I'll reproduce a generic example I sent a friend.

Prompt:

    const redis = require('redis');

    // Create a redis client
Copilot suggested:

    const client = redis.createClient();
I accepted it and moved 2 lines down, prompt:

    // Get the current count from redis
Copilot suggested a start to the operation:

    client.get('count', (err, count) => {
I accepted it, and Copilot continued:

      if (err) {
        console.log(err);
        return;
      }

      // If there is no count, set it to 0
      if (!count) {
        count = 0;
      }

      // Increment the count
      count++;

      // Set the new count in redis
      client.set('count', count);
  
      // Log the new count
      console.log(count);
    }
◧◩◪◨⬒
5. foepys+Zp[view] [source] 2021-10-27 19:41:29
>>gfosco+1n
Redis has the INCR command that does this in redis without the additional round-trips (and race conditions). It also sets the value to 0 if the key doesn't exist.

So, I actually consider this to be exactly the bad behavior that people accuse Copilot of.

◧◩◪◨⬒⬓
6. speedg+xu[view] [source] 2021-10-27 20:03:32
>>foepys+Zp
Yes it's not very shinning there. I would also throw the error instead of printing the error to the console and returning undefined.
◧◩◪◨⬒⬓⬔
7. ponyou+aQ[view] [source] 2021-10-27 22:12:08
>>speedg+xu
You are in a callback there. Goodbye your error!
[go to top]