Copilot はコーディングを学ぶのに役立ちますか?
はい。 Copilot は、コーディングの過程を通じて変化するニーズに合わせて適応できます。 経験豊富な開発者は、 Copilot をコーディング アシスタントとして使用します。 コーディングを学んでいる間は、サポート コンパニオンとしてさらに有益です。
このガイドでは、コードの記述に依存するのではなく、プログラミングの概念を深く理解するのに役立つ講師として機能するようにCopilotを設定する方法について説明します。 学習を最適なものにするには、作業するリポジトリごとに以下の手順を行います。
前提条件
このガイドでは、CopilotでVS Codeを使用することを前提としています。 セットアップするには、VS CodeドキュメントのVisual Studio Codeの「Copilotを設定する」を参照してください。
手順 1: Copilot インライン候補を無効にする
まず、インライン検索候補を無効にしましょう。 このようにすると、自分で記述するコードが増えるため、プログラミングの概念の理解を深める機会が得られます。
-
VS Codeで、プロジェクトを開きます。
-
ルート ディレクトリに
.vscodeという名前のフォルダーを作成します。 -
.vscode内に、settings.jsonという名前のファイルを作成します。 -
ファイルに次のテキストを追加します。
JSON { "github.copilot.enable": { "*": false } }{ "github.copilot.enable": { "*": false } } -
ファイルを保存します。 Copilot インライン候補は VS Code でこのプロジェクトに対して無効化されました。
ステップ 2: 学習の指示を追加する
それでは、学習をサポートする講師として行動するための指示を Copilot Chat に提供しましょう。
-
ルート ディレクトリに
.githubという名前のフォルダーを作成します。 -
.github内に、copilot-instructions.mdという名前のファイルを作成します。 -
次のテキストを追加するか、個人の学習目標に合わせてそれをカスタマイズします:
Markdown I am learning to code. You are to act as a tutor; assume I am a beginner 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 beginner 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." -
ファイルを保存します。 Copilot は、 Copilot Chatで質問する際に次の手順を使用します。
手順 3: Copilot Chat を使用して学習する
Copilotの助けを借りて、実際のコーディングスキルの構築を開始する準備ができました。
プロジェクトの作業全体を通して、 Copilot Chat との長時間にわたる会話に参加します。 それを個人チューターとして扱い、わからないことがあったら質問し、それを使って課題に取り組んだり、概念を明確にしたりします。
でCopilot Chatを開くVS CodeCopilot Chat は、コードのデバッグに特に役立ちます。 詳しい手順については、「GitHub Copilotを使用したデバッグの学習」を参照してください。