Visual Studio Developers Share AI Prompts for Enhancing Code with Copilot

Visual Studio Developers Share AI Prompts for Enhancing Code with Copilot

Breaking News

Visual Studio Developers Share AI Copilot Prompts for Better Coding

Mads Kristensen, a principal product manager at Microsoft, has appealed to Visual Studio developers via social media to share their most effective prompts for using GitHub Copilot AI to enhance code quality.

About Mads Kristensen

Kristensen is well-known within the Visual Studio community for creating numerous extensions that often get incorporated into the Integrated Development Environment (IDE). He regularly uses social media to showcase new features and solicit feedback from users. This week, he reached out with the question: “What are your favorite prompts for GitHub Copilot to help improve your code?”

Practical Prompts for AI Assistance

To kick off the discussion, Kristensen shared a useful prompt he often employs: “Add missing XML Doc Comments, including the purpose and reasoning behind the code. This helps new developers understand the project better. If comments are already there, update them to clarify and enrich the information.” He also emphasized not to include documentation that is too obvious for even novice developers.

Responses from the development community poured in, showcasing various approaches to prompt usage:

  • “CRUD operations. I ask Copilot to expand my brief outline into a detailed implementation, which I then review and adjust.”
  • “Convert the selected properties to camelCase saved me a lot of time recently.”
  • “For this source file, produce a mermaid-based flowchart or a markdown readme. Produce triple slash comments with links to objects and brief descriptions of each method.”
  • “Format this document” as a solution to a recurring formatting issue I face with the current update.
  • “Fix this to-do item as needed.”
  • “Can you create a class to deserialize this huge XML file?”
  • “Write me a unit test with edge case scenarios and verify it later.”
  • “Scaffold some unit tests, as I’ve likely written them already!”
  • “Add a synopsis for this specific function.”
  • “Write in Go language instead of C#.”

Community Engagement and Resources

Kristensen’s announcement reached approximately 16,000 viewers, demonstrating the strong interest in collaborative sharing among developers. Many other developers chimed in, offering more prompts, while a few shared screenshots to illustrate their suggestions.

Resources that can aid in crafting effective prompts are plentiful. GitHub has a dedicated repository called Prompt Engineering for Copilot Chat. Furthermore, Greg Brockman, president of OpenAI, shared tips on prompting in an article titled “Four Pillars of AI Prompting by OpenAI’s President Greg Brockman — Master AI Like a Pro!

Recently, Microsoft also published guidelines for creating effective prompts, available in Create Effective Prompts and the older post 15 Tips to Become a Better Prompt Engineer for Generative AI.

Please follow and like us:

Related