Können Copilot mir dabei helfen, das Programmieren zu erlernen?
Ja! Copilot kann sich an geänderte Anforderungen während des gesamten Lernprozesses anpassen. Wenn du ein erfahrener Entwickler bist, verwende Copilot als Programmier-Assistent. Wenn du das Programmieren erst erlernst, solltest du es als unterstützenden Begleiter sehen.
In diesem Leitfaden erfährst du, wie du Copilot einrichtest, um als Tutor zu fungieren, der dir dabei hilft, ein tiefes Verständnis der Programmierkonzepte zu entwickeln, anstatt dich darauf zu verlassen, dass Copilot den Code für dich schreibt. Befolge diese Schritte für jedes Repository, an dem du arbeitest, um deinen Lernerfolg zu maximieren.
Voraussetzungen
In diesem Leitfaden wird davon ausgegangen, dass du Copilot in VS Code verwendest. Informationen zum Einrichten findest du unter Einrichten von Copilot in VS Code in der Dokumentation zu Visual Studio Code.
Schritt 1: Copilot Inlinevorschläge deaktivieren
Zunächst deaktivieren wir Inlinevorschläge. Dadurch kannst du dein Verständnis der Programmierkonzepte zu vertiefen, indem du selbst mehr Code schreibst.
-
Öffne dein Projekt in VS Code.
-
Erstelle einen Ordner namens
.vscodeim Stammverzeichnis. -
Erstelle in
.vscodeeine Datei namenssettings.json. -
Fügen Sie der Datei den folgenden Text hinzu:
JSON { "github.copilot.enable": { "*": false } }{ "github.copilot.enable": { "*": false } } -
Speichern Sie die Datei . Copilot Inline-Vorschläge sind für dieses Projekt in VS Code jetzt deaktiviert.
Schritt 2: Hinzufügen von Lernanweisungen
Nun geben wir Copilot-Chat Anweisungen, wie sie sich als Tutor verhalten sollen, der Ihr Lernen unterstützt.
-
Erstelle einen Ordner namens
.githubim Stammverzeichnis. -
Erstelle in
.githubeine Datei namenscopilot-instructions.md. -
Füge den folgenden Text hinzu, oder passe ihn an deine persönlichen Lernziele an:
Markdown I am learning to code. You are to act as a tutor; assume I am a beginning coder. Teach me coding concepts and best practices, but do not provide solutions. Explain code conceptually and help me understand what is happening in the code without giving answers. Do not provide code snippets, even if I ask you for implementation advice in my prompts. Teach me all the basic coding concepts in your answers. And help me understand the overarching approach that you are suggesting. Whenever possible, share links to relevant external documentation and sources of truth. At the end of every response, add "Always check the correctness of AI-generated responses."
I am learning to code. You are to act as a tutor; assume I am a beginning coder. Teach me coding concepts and best practices, but do not provide solutions. Explain code conceptually and help me understand what is happening in the code without giving answers. Do not provide code snippets, even if I ask you for implementation advice in my prompts. Teach me all the basic coding concepts in your answers. And help me understand the overarching approach that you are suggesting. Whenever possible, share links to relevant external documentation and sources of truth. At the end of every response, add "Always check the correctness of AI-generated responses." -
Speichern Sie die Datei . Copilot verwendet diese Anweisungen, wenn Sie Fragen in Copilot-Chat stellen.
Schritt 3: Verwenden von Copilot-Chat zum Lernen
Jetzt kannst du mithilfe von Copilot echte Programmierkenntnisse aufbauen.
Während der gesamten Arbeit am Projekt führen Sie eine Unterhaltung mit Copilot-Chat. Betrachte Copilot als deinen persönlichen Tutor, stellen Fragen, sobald sie aufkommen, und lass dir dabei helfen, Herausforderungen zu bewältigen oder Konzepte zu erklären.
<a href="vscode://GitHub.Copilot-Chat?ref_product=copilot&ref_type=engagement&ref_style=button" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline" aria-label="Open Copilot Chat in Visual Studio Code"> <span>Öffnen Sie Copilot-Chat in VS Code</span> <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-link-external" aria-label="link external icon" role="img"><path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path></svg> </a><br></br>
Copilot-Chat ist besonders hilfreich beim Debuggen deines Codes. Eine Schrittanleitung findest du unter Lernfortschritte beim Debuggen mit GitHub Copilot.