Getting started with GitHub Copilot
source link: https://www.thoughtworks.com/insights/blog/generative-ai/getting-started-with-github-copilot
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Getting started with GitHub Copilot
More and more developers across Thoughtworks and at our clients are using GitHub Copilot for coding assistance. We have an internal guidance document that we are continuously updating as people are reporting back with their learnings and pitfalls. This is a high-level summary of that guidance document, focussed on the minimum a developer should know when they are getting started with an in-line coding assistance tool like GitHub Copilot.
We are also publishing a series of more detailed memos about our learnings with AI-assisted software delivery in general over on martinfowler.com.
Relatively straightforward or standard problems — repetitive, boilerplate, common logic like list processing, a repeating pattern, things you’d usually copy & paste.
Commonplace languages and frameworks.
Tasks you know how to do in theory, but you need assistance with the details. You should know enough to judge if Copilot’s suggestions makes sense.
For small chunks: About 10-15 lines of code, maximum, so that you can follow along, and don’t increase your cognitive load with lots of code review.
Beware: Copilot can amplify “bad” local code
Getting stuck in older patterns
After refactoring, or introducing new patterns into the codebase, you might find that Copilot is still stuck in “the old ways”.
Proliferating bad practices
Copilot uses our existing code to make more suitable suggestions for our context, but depending on what it chooses as its example, it creates either the good or the bad kind of consistency.
Move on
Don’t spend too much time fixing things if the suggestions are obviously not useful. Two strikes and move on!
Review fatigue
The larger the piece of code generated, the more code review you will have to do! Consider the balance between the “typing” boost and the energy needed for review.
Prompt abstraction
If prompting takes more time than coding itself, consider if it’s a good use case for Copilot, or if you should discard the assistance and write the code yourself.
Automation bias
Once you have had some success with Copilot, be careful not to start over-trusting it.
Sunk cost fallacy
Even though with Copilot, we did not invest time to write a suggestion ourself, we might still get over-attached to the supposed time saved of a multi-line suggestion.
Anchoring bias
Be aware that once you have seen Copilot’s suggestions, you might have a harder time thinking about other solutions.
Security vigilance
Copilot does some pre-filtering for vulnerable patterns, but you cannot rely on the code to be secure for your context. Especially watch out for hallucinated dependency names.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK