VOOZH about

URL: https://thenewstack.io/5-strategies-for-better-results-from-an-ai-code-assistant/

⇱ 5 Strategies for Better Results from an AI Code Assistant - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-04-24 10:25:43
5 Strategies for Better Results from an AI Code Assistant
sponsor-tabnine,sponsored-topic,
AI / Software Development / Software Testing

5 Strategies for Better Results from an AI Code Assistant

Developer Advocate Rizel Scarlett shared how to make AI coding assistants more effective and efficient this week at InfoBip Shift.
Apr 24th, 2024 10:25am by Loraine Lawson
👁 Featued image for: 5 Strategies for Better Results from an AI Code Assistant
Photo by Loraine Lawson

Copilots, like all GenAI, are non-deterministic; meaning they vary in outcome. But while using AI code assistants, developers can use prompt engineering to refine and guide the AI for better outcomes, according to Rizel Scarlett — who is a developer advocate, including recently for GitHub Copilot.

Scarlett is now a staff developer advocate at TBD, a business unit operating within Block that’s building open source platforms and protocols for exchanging money internationally. She shared five strategies for improving a copilot’s results at this week’s InfoBip Shift conference in Miami.

First, she set up a scenario: Imagine, she asked the audience, a developer named Dawson who suffers a bit from imposter syndrome. Fortunately for Dawson, she has a friend who can help — a developer and time traveler named Phil, from Disney’s Phil of The Future, except he’s all grown up.

Dawson has a problem: She has to create an identity verification program, but she doesn’t know how and she’s unsure how to really leverage Copilot to help her, Scarlett said. Phil is from the 22nd century when AI assistants are the norm. He helps her jumpstart her efforts with five strategies for prompting Copilot.

Strategy 1: Provide High-Level Concepts

The first step is to provide the GPT with high-level context. In her scenario, Phil demonstrates by building a Markdown editor. Since Copilot has no idea of the context, he has to provide it and he does this with a large prompt comment with step-by-step instructions. For instance, he tells the copilot, “Make sure we have support for bold, italics and bullet points” and “Can you use reactions in the React markdown package.” The prompt enables Copilot to create a functional but unsettled markdown editor.

Strategy 2: Provide Details

Follow up by providing the Copilot with specific details, Scarlett advised.

“If he writes a column that says get data from [an] API, then GitHub Copilot may or may not know what he’s really trying to do, and it may not get the best result. It doesn’t know which API he wants to get the data from or what it should return,” Scarlett said. “Instead, you can write a more specific comment that says use the JSON placeholder API, pass in user IDs, and return the users as a JSON object. That way we can get more optimal results.”

Strategy 3: Provide Examples

There are three terms to understand when it comes to giving AI examples, Scarlett said:

  • Zero-shot learning, in which the model is expected to correctly make predictions for tasks on which they have never been explicitly trained. A human example would be trying to defeat a video game without playing it, but using strategies the gamer learned from previous video games.
  • One-shot learning, which provides a single example to the AI. The corollary is being expected to competently play any character and defeat any opponent after playing one match in the game.
  • Few-shot learning, where the model is provided with a small set of examples. This would be like doing two to five missions in the new game and then being expected to fully navigate the game.

Strategy 4: Keep A Few Tabs Open

This one may seem a bit surprising, but keeping open a tab or two open in the editor allows GitHub Copilot to gain context from the tabs. Too many open tabs can lower the quality of the Copilot suggestions, she cautioned.

Strategy 5: Use Copilot Chat

Our heroine Dawson loves the advice and results, but she actually would like to get code feedback. Copilots come with a chat function, which can be used for tasks such as fixing bugs, formatting dates, refactoring code, testing code and generating tests, Scarlett said. It can be asked to identify any bugs and then asked to provide a solution with a brief explanation, she said. She then demoed asking GitHub Copilot to generate a test using the open source JavaScript testing framework, Jest. (Microsoft’s Copilot also offers a chat interface.)

By using Copilots, developers can do more than increase productivity, Scarlett added. Copilots can also improve psychological safety, especially in new developers or others who might have imposter syndrome, she said.

“Unfortunately, the reality is psychological safety is not always common at work, especially in second history, and especially for minorities,” she said. “Beginner devs can gain reassurance from a Copilot because it can act as a peer, providing us with ideas when using a new tool for the first time.”

Our goal at Tabnine is to create and deliver a top-to-bottom AI-assisted development workflow that empowers all code creators, in all languages, from concept through to completion.
Learn More
The latest from Tabnine
TRENDING STORIES
Loraine Lawson is a veteran technology reporter who has covered technology issues from data integration to security for 25 years. Before joining The New Stack, she served as the editor of the banking technology site Bank Automation News. She has...
Read more from Loraine Lawson
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.