DEV Community

Cover image for Introduction to Visual Studio Code GitHub Copilot Using GitHub Education

Introduction to Visual Studio Code GitHub Copilot Using GitHub Education

This article was co-authored by @jcgabano

Introduction

Anyone who just started college and is diving into the world of computer science could find the challenge of programming without any experience to be quite daunting. It's like entering a country where everyone speaks a language you've never heard before. Words like "variables", "loops", and “functions" initially sound like gibberish and trying to comprehend them feels as perplexing as deciphering symbols.

Imagine trying to build a structure without any knowledge of architecture or engineering principles. That's how anyone would often think about programming as a beginner. It's not just about typing some lines of code but rather it's about understanding the logic and problem solving strategies behind each instruction. Every punctuation mark, from semicolons, to braces holds significance and even a small mistake can cause the entire program to collapse like a house of cards. It's a journey that requires patience, resilience and an acceptance that failure's an essential part of learning.

With that, GitHub Copilot could be the best tool to guide amateurs in this field. GitHub Copilot is a tool that feels like a guiding hand in the midst of chaos. With its AI-powered suggestions and auto-completions, Copilot acts as a helpful companion for the amateur programmer, offering insights and assistance when needed most. Its ability to generate code snippets based on context and intent not only speeds up the coding process but also serves as a valuable learning tool, providing real-time feedback and suggestions for improvement. While it's not a substitute for understanding the fundamentals of programming, Copilot serves as a useful aid for navigating the complexities of coding and offers a glimpse into the possibilities of AI-driven development tools. With Copilot with your side, the journey from novice to proficient programmer would feel a little less daunting, and the path ahead a little clearer.

What is GitHub?

GitHub is an innovative open-source development platform that is dynamic and inclusive. Its purpose is to make code management, sharing, collaboration, and storage easy by allowing users to create repositories. Simply put, GitHub embodies its title by utilizing the capabilities of the Git software. The platform offers a range of services designed to improve the user experience. These services include refined bug tracking tools, lively communities for collaborative interaction, and web-based Git repository hosting services that simplify version control. This combination of characteristics encourages creativity and a sense of camaraderie among software developers in addition to enabling developers to work more productively.

What is GitHub Education?

GitHub Education is an extension of the GitHub platform designed specifically for educational institutions. It enhances their coding activities by giving them free access to a variety of developer tools that GitHub's partners offer. This extension was created with the goal of improving the educational process. It is designed to assist teachers and students in learning critical skills like teamwork and efficient code management. GitHub Education contributes to fostering a dynamic and inclusive educational environment where the next generation of developers can cultivate their expertise and thrive in the ever-evolving landscape of software development.

What is GitHub Copilot?

GitHub copilot is a cloud-based artificial intelligence tool developed by GitHub and OpenAI (the same company that made ChatGPT) to assist users by auto completing their code. This works by programmers providing a description of what problem the code must solve and copilot will generate a solution. Copilot is currently available by subscription to individual developers and to businesses. It includes various assistive features for programmers, such as turning comments into code and completing different sections of code, copilot has been helping programmers all around the world complete their code.

What is Visual Studio Code?

Visual Studio Code or VSCode for short is a code editor created by Microsoft optimized for building and debugging modern web and cloud applications. It is a free open source integrated development environment (IDE) that can code in multiple programming languages. Known for its efficiency and resourcefulness, it's no surprise that VSCode is the most popular code editor amongst programmers. You can find almost anything you need to edit your code in VSCode such as coding extensions like GitHub's Copilot.
Reference: https://code.visualstudio.com/

How to create a GitHub Account and apply for GitHub Student Benefits (Education)?

STEP 1: Search github.com in any browser
Image description

STEP 2: To create a GitHub account, click the Sign up button and enter your email address.
Image description

STEP 3: Press continue and create a strong password. The password must consist of at least 8 characters, minimum of one uppercase and lowercase letter, a number, and a symbol.
Image description

STEP 4: Enter a username. The username must be unique and may only contain alphanumeric characteristics (only letters and numbers). The username must not contain any symbol, space, underline, etc.
Image description

STEP 5: Check the checkbox if you want to receive occasional updates and announcements via email.
Image description

STEP 6: Complete the verification process
Image description

STEP 7: Enter the code sent via email.

Image description

STEP 8: Complete the form asked and don’t forget to click the student option for easy application in GitHub Student Benefits.
Image description

STEP 9: Check all the checkboxes for GitHub personalization.
Image description

STEP 10: To get the additional student benefits, scroll down and click the “Apply for your GitHub Student benefits”.
Image description
Image description

STEP 11: Sign up for Student Developer Pack.
Image description

STEP 12: Click the “Get student benefits” under the “Individuals” section.
Image description

STEP 13: Read all the qualifications to proceed
Image description

STEP 14: Enter your email address and the name of your school. Then, click continue to proceed.

Image description

STEP 15: To proceed, you must check if the two-factor authentication (2FA) is enabled). There are two options that you can choose, the SMS Authentication and Authenticator app. In this scenario, we use the SMS Authentication option.
Image description

Image description

STEP 16: Upload proof of your academic status and click “Process my application” to proceed.
Image description
Image description
Image description

STEP 17: If your application for GitHub Student Benefits has been accepted and qualified, wait for their email.

Reference: https://www.youtube.com/watch?v=xFN7vjN5dWk

How to install GitHub Copilot in Visual Studio Code?

STEP 1: Open Visual Studio Code and Search GitHub Copilot in the Extensions. Then, install.
Image description

STEP 2: Go to github.com and sign in your previously made account. Then click your icon and click “Feature preview”.
Image description

STEP 3: Click to enable all disabled features
Image description

STEP 4: Return to Visual Studio Code and create a new file for testing.
Note: If you already see “Press control + I to ask Copilot Chat to do something”, it means the GitHub Copilot has been successfully activated.
Image description

Reference: https://www.youtube.com/watch?v=0dSKt4DgnyA

Getting Started GitHub Copilot

Image description
Reference:https://docs.github.com/en/copilot/using-github-copilot/getting-started-with-github-copilot

GitHub Copilot Features

1. Q&A Comment Blocks
By typing the comment syntax/notation in every language together with “q:” before the question, it will automatically provide an answer by clicking enter.

Image description

To accept the suggestion, simply click the tab or “control + →”

Image description

2. Copilot Chat Window
By pressing the chat icon in the left part of the vs code, you can access the copilot chat feature. This is to provide a way for users to communicate with the copilot. This can be used to ask questions, get help, or provide feedback. The chat window can also be used to view the copilot's responses and to see the copilot's thought process as it works on a task.
Image description

3. Language Support
GitHub Copilot offers language support across a diverse range of programming languages, drawing from extensive machine learning models trained on publicly available code repositories. Supporting popular languages like Python, JavaScript, Java, and more, it assists developers by suggesting code snippets, completing suggestions, providing function signatures, and contextual documentation. Leveraging its analysis of coding patterns and conventions, Copilot generates code suggestions aligned with the surrounding context, even offering to generate entire functions, classes, or files. While its language support continually improves through learning from GitHub's vast code repository, developers should always review and verify the suggested code to ensure alignment with their specific requirements and coding standards.

4. Code Suggestions
GitHub Copilot's code suggestion feature, powered by AI, streamlines coding by providing context-aware suggestions gleaned from extensive analysis of open-source code. By predicting and suggesting code snippets as developers type, Copilot accelerates coding processes, reducing manual input and saving time. It draws from both the current file and other open-source projects, considering language, libraries, and frameworks to offer precise suggestions, including entire functions, classes, or smaller code elements like loops and conditionals. While it enhances productivity, developers must review suggestions to ensure accuracy and efficiency, emphasizing the tool's supportive role rather than a replacement for programming proficiency. In summary, GitHub Copilot's code suggestion feature enhances developer efficiency through intelligent, context-aware suggestions derived from diverse code sources.
Image description

5. Built-in Fix it and Explain it Feature
GitHub Copilot is an AI-powered coding assistant that provides suggestions and fixes for your code as you write it. It has two main features: "Fix It" and "Explain It".

The "Fix It" feature suggests code changes to fix errors or improve the code based on the context. For example, if you have a syntax error or a logical mistake in your code, Copilot can provide a suggested fix to correct it. It analyzes the code you've written so far and tries to understand your intent, then generates code that aligns with that intent. This can save you time and help you avoid common mistakes.

The "Explain It" feature provides explanations for code snippets or concepts. If you have a specific line of code or a programming concept that you're unsure about, you can use the "Explain It" feature to get a detailed explanation. Copilot will analyze the code and provide a clear explanation of what the code does, how it works, and any relevant concepts or principles involved. Both of these features are designed to assist developers in writing code more efficiently and effectively. They can help you catch errors, improve code quality, and deepen your understanding of programming concepts. However, it's important to review and understand the suggestions provided by Copilot, as it is an AI and may not always generate the most optimal or correct code. It's always a good practice to critically evaluate the suggestions and make any necessary adjustments before incorporating them into your codebase.

Reference: https://www.youtube.com/watch?v=2nPoiUJpDaU

Why should you use Copilot to help your coding experience?

GitHub Copilot is an innovative code writing tool that will greatly improve your coding experience. This expedites the coding process and encourages excellent practices by providing recommendations that are appropriate for the given problem. Copilot is a great resource for learning new programming languages, libraries, and frameworks, regardless of experience level. It lessens the mental strain of learning grammar, freeing you up to concentrate more on architecture and problem-solving. Furthermore, Copilot facilitates teamwork by optimizing the code review procedure and cultivating a more effective and uniform coding atmosphere inside groups. For developers aiming to increase productivity and improve their entire coding experience, GitHub Copilot is an invaluable tool because it may save time, better code quality, and promote teamwork.

Top comments (0)