본문 바로가기
카테고리 없음

🔍 Effective Prompts for GitHub Copilot:

by IT트레이서 2023. 12. 15.

📝 Explain the selected code: Get a clear understanding of what your code does.

  • 🧐 Make this code more readable: Transform complex code into something simpler.
  • ✂️ Separate out the validation functions and add comments: Organize and clarify your validation logic.
  • 🐞 Propose a fix for the bugs in my code: Identify and solve those tricky bugs.
  • 🧪 Write a set of unit test functions for the selected code: Ensure your code is robust and error-free.
  • How does variable visibility work in Python? Can you give me an example?: Dive deep into Python's variable scope.

🎨 Crafting the Perfect Prompt:

🤖 Prompt crafting is all about giving clear and concise instructions to computer programs, like the large language models powering GitHub Copilot.

  • 🗣 Comment-Driven Development: Begin with a few lines of comments outlining your project's goal.
  • 🔄 Be Flexible: If the first answer doesn’t fit, try rephrasing your question.
  • 🧩 Provide Examples: Working with data? Show your desired start and end points.
  • ✏️ Name Things Properly: Clear names for variables and functions add context and clarity.
  • 👍 Follow Best Practices: Your code's style and structure guide the suggestions you'll receive.
  • 📂 Open Relevant Files: When using custom frameworks, have representative examples handy.