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.
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);
}So, I actually consider this to be exactly the bad behavior that people accuse Copilot of.