I’d be more interested to see the other stats..
How much code is AI generated and then modified.
How much modification is typically needed.
How often suggestions are not used/abandoned/deleted.
11–20 of 129 posts
I’d be more interested to see the other stats..
How much code is AI generated and then modified.
How much modification is typically needed.
How often suggestions are not used/abandoned/deleted.
That question generated this code: [I did not write anything beyond this point]
Here's an example function that searches for a lead in Salesforce using jsforce and updates an activity record with the duration of the call:
``` exports.handler = async (event, context) => { const jsforce = require('jsforce');
// Create a connection to Salesforce using the access token and instance URL
const conn = new jsforce.Connection({
instanceUrl: event.salesforce.instanceUrl,
accessToken: event.salesforce.token
});
// Search for a lead with the given caller number
const lead = await conn.sobject('Lead').findOne({ Phone: event.activity.caller_number });
if (lead) {
// If a lead is found, update the activity record with the duration of the call
const duration = 10; // Replace with actual duration of the call
await context.ctm.update({
activity: {
id: event.activity.id,
duration: duration
}
});
} else {
console.log('Lead not found');
}
};
```Note that this function assumes that the caller number is stored in the Phone field of the Lead object in Salesforce. You may need to modify the code to match your specific use case. Also, the duration of the call is hardcoded to 10 seconds in this example, but you should replace it with the actual duration of the call.
lol I use co-pilot and there is no way this stat is true.
In my experience it's more like 80-90%, given the right prompts. Very little needs to be changed, usually
For more custom stuff, I mostly just ignore the suggestions since they are mostly useless.
A lot of the code it generates is trivial, or 1-2 lines of code that's obvious, at least for me. In which case, it makes no sense to modify it. I have a feeling this is the bulk of it.
This is my experience as well. For longer code, Copilot introduces errors through making up variables and method names that don't actually exist on the object. These errors are very annoying but only 5% of the generated code.
Maybe I should have lowered expectations and thought of it as improved code complete. I got spoiled by copy/pasting from ChatGPT. As it stands now I'd rather pay for a subscription to have the latest ChatGPT than for Copilot.
On the other side you have devs who have AI in their head. They often use tools to optimise their flow. Ive always used resharper as a developer and think autocomplete is certainly a developer efficiency improver. 99% of the suggestions resharper makes, i checkin. Thats why i use it, it has less fuzz because it doesnt try to be everything.
Pressing alt+tab and scrolling through some search results isnt something that adds overhead to my flow - after 30yrs im pretty good filtering content.
I do alot of PoCs though, so if i wanted to write in a language i didnt understand, i think copilot can improve my flow somewhat to get me to serach terms that will benifit me quicker.
Overall im still a few years away from relying on AI to help me code. Its going to be great for retirement though, if i had a family and kids it would allow me to checkout of self-paced learning while still maintaining my edge.
Earlier quoted context omitted.
In my experience it's more like 80-90%, given the right prompts. Very little needs to be changed, usually
I'd say closer to 40%. You almost ways need to adjust the parameters of function. Almost always need to rename variables, etc. And this is writing mostly boilerplate too. For more custom stuff, I mostly just ignore the suggestions since they are mostly useless.
> there is no way that stat is true
> I'd say closer to 40%
What?
I'm not surprised. A lot of the code I'll write in a day is trivial, calling helpers, writing test scaffolding, etc. I'm still building cool things the other 60% of time, but this job as we know it comes with a lot of repetition. (esp. if you write unit tests ;-))
unit test definitely a great use of copilot.
I don't know anyone who uses it for this; specifically tests are really bad if they're subtly wrong.
Maybe to scaffold the test function, but the actual test if completely useless if you don't trust it.
So like... generate code and have robust tests, or write robust code... but, it's really really daft to generate tests that might hallucinate some random crap (and copilot really does sometimes).
Other people have said this, but copilot is auto complete.
You use it every time you press tab.
Do you accept an auto-complete suggestion 40% of the time? ...mmmm, yes, well, guess why 40% of code is generated by copilot.
It's not because people are generating tests with it.
Earlier quoted context omitted.
I'd say closer to 40%. You almost ways need to adjust the parameters of function. Almost always need to rename variables, etc. And this is writing mostly boilerplate too. For more custom stuff, I mostly just ignore the suggestions since they are mostly useless.
> 40% of the code GitHub Copilot users check-in is AI generated and unmodified > there is no way that stat is true > I'd say closer to 40% What?
The shorter the prediction the higher probability of it being correct.
The longer, and more complex the prediction the less likely it’s all correct. But, with a close review you can spot the errors and correct it.
I’ve found most useful to get ideas on the page fast.
It’s also absolutely insane to be writing a parser, and have it suggest unit tests and code where it clearly has developed an understanding of the language before the parser is complete.
Earlier quoted context omitted.
unit test definitely a great use of copilot.
What are you talking about? I don't know anyone who uses it for this; specifically tests are really bad if they're subtly wrong. Maybe to scaffold the test function, but the actual test if completely useless if you don't trust it. So like... generate code and have robust tests, or write robust code... but, it's really really daft to generate tests that might hallucinate some random crap (and copilot really does somet…