GitHub Copilot Chat is a conversational generative AI tool for software questions and coding tasks. It resembles ChatGPT and Google Gemini, but integrates with Microsoft software and offers web, desktop, and mobile interfaces. Its responses emphasize simple requests, search-like interaction, and agent mode for attempting tasks step by step. section 1.2.2
Inside Visual Studio Code, Copilot Chat acts as a coding assistant. Ask questions in plain English, paste the relevant code, and review the proposed revision rather than treating generated code as tested or optimized. section 2.5 section 2.5.2
Refactoring a Python file reader
A small Python project counts word frequencies in a Project Gutenberg text and displays the results in a bar chart. Copilot can suggest a file-reading function from its name, or improve an inefficient implementation after the prompt “How can I improve this code?” A clearer response uses a context manager, a descriptive variable, and a docstring; the developer still checks the result and may add an explicit UTF-8 encoding. section 2.5 section 2.5.2
A practical Copilot Chat workflow:
- Describe one small programming task or name a function clearly to invite a focused suggestion. section 2.5.2
- Paste imperfect code with a plain-English improvement request when refactoring is the goal. section 2.5.2
- Compare alternatives for readability and efficiency, then test, understand, and revise the selected code. section 2.5.2
def read_text_file(file_path):
with open(file_path, 'r') as f:
return f.read()
A compact context-manager implementation illustrates the kind of file-reading function Copilot may suggest. section 2.5.2




