GitHub Copilot: Gaining Practical Insight into AI-Driven Code Autocompletion
Ravi Prakash Gupta
Simplifying AI for everyone | Phd Candidate - Gen AI | Chief Consultant @Byond Boundrys
GitHub Copilot is an innovative coding companion powered by artificial intelligence.
It is designed to assist developers in writing code more efficiently and effectively by providing suggestions, autocompletion, and even generating entire code snippets based on natural language descriptions and comments.
GitHub Copilot is built upon OpenAI's GPT (Generative Pre-trained Transformer) technology and is trained on a wide variety of programming languages, frameworks, and code patterns.
It integrates seamlessly into popular code editors like Visual Studio Code, making it accessible to a wide range of developers.
The Power of GitHub Copilot:
Features of GitHub Copilot: https://github.com/features/copilot
Exploring the Path of GitHub Copilot’s Journey:
Install Visual Studio/VS Code:
If not already installed, download and install Visual Studio or Visual Studio Code from their respective websites.
Install GitHub Extension:
In Visual Studio or VS Code, go to the Extensions Marketplace and search for the "GitHub" extension. Install the official GitHub extension to integrate GitHub features.
GitHub Account:
If you don't have a GitHub account, create one on the GitHub website.
Sign In to GitHub:
Open Visual Studio/VS Code and sign in to your GitHub account using the GitHub extension. This step will link your IDE with your GitHub account.
Repository Creation:
Create a new repository directly from your IDE or clone an existing repository from GitHub.
Set-Up Remote: If creating a new repository, the extension will guide you through the process. If cloning an existing repository, set up the remote connection to your GitHub repository.
Branching & Code Management:
Use the extension to create and manage branches, commit changes, and sync them with your GitHub repository.
Pull Requests & Reviews:
The extension allows you to create pull requests, review code changes, and merge them with the main branch.
Push & Pull:
Push local changes to your GitHub repository and pull changes from the remote repository to keep your local code up to date.
GitHub Actions (Optional):
If desired, set up GitHub Actions within your repository to automate workflows, such as testing and deployment.
Extensions & Customization (Optional):
Explore additional extensions to enhance your GitHub experience within Visual Studio/VS Code. Customize settings as per your preferences.
GitHub In Practice: Exploring Commands ?using GitHub Copilot
With GitHub Copilot integrated, I revisited an existing API project. Here’s the CustomerDto model I worked with:
I issued a few commands to see how GitHub Copilot would respond. The results varied, but here's a snapshot:
Create Data Command:
Generated Code:
Swagger Output:
Update? Command:
Generated Code:
Swagger Output:
Delete Command :
领英推荐
Generated Code:
Swagger Output:
Crud Operation On Web Pages :
Create Command :
Controller (Get):
Generated Code (Controller):
View:
Bind Model:
Command for Bind Model in the View
Generated Code:
Command? for? form:
Generated Code:
Web Output:
Result:
Delete? Command:
Generated Code:
Web Output:
After Button Click:
The Good and The Not-So-Good:
Pros:
Increased performance: GitHub Copilot allows you to develop code faster than you can write it. This can be especially helpful when running large projects or facing tight deadlines.
Code consistency: GitHub Copilot can help ensure the integrity of your project’s code, making it easier to maintain and debug.
Reduced development time: Since GitHub Copilot can generate code for you, you can focus on other tasks, such as testing, debugging, or just proper rest This can help reduce and provide overall development time your team’s performance has increased.
Improved Code Quality: GitHub Copilot uses machine learning algorithms for code generation, so it can find solutions you may not have thought of yourself. This can lead to better and more effective legislation.
Accessibility: GitHub Copilot can help make programming more accessible for people with less coding experience. It can also help reduce barriers to entry for new entrants and could be particularly important in a region often criticized for being too insular.
Cons:
Code Ownership: One of the concerns of GitHub Copilot is who owns the code that does it. If you use GitHub Copilot to generate code, who has the rights to that code? This can be particularly troublesome for companies, which want to ensure that they own all the code that their employees make.
Intellectual Property Rights: There is also concern about intellectual property rights related to legal ownership. When you use GitHub Copilot to generate code, are you inadvertently infringing on someone else’s intellectual property rights?
Potential biases: Like any AI-powered tool, GitHub Copilot is only as good as the data it’s trained on. This means that it can perpetuate existing biases in the data such as gender or racial biases. This may lead to inadvertent discrimination in the resulting rules.
Lack of creativity: While GitHub Copilot is great at creating code based on existing examples and best practices, it may not be so good at coming up with truly innovative solutions This can stifle the creativity it has the edge of developers who rely too heavily on the tool.
Dependencies: Finally, there is a concern that developers may rely too heavily on GitHub Copilot, and lose the ability to write code from scratch. This can hinder their growth as developers and can also hurt their career prospects in the future.
Disclaimer: This review is purely based on my personal experience and is not influenced or sponsored by any entity. I am sharing my unbiased user perspective, and I am not an influencer or affiliated with any brand mentioned in the review.
Senior Technical Lead at Taazaa | Expert in Mobile App Development (Flutter, Android, iOS) | 100+ SDE Mentorship Sessions | Certified Scrum Master?
1 年Thanks for this insightful post. ????
Senior Director Engg | Head of Java Practice | ex-BlackRock (VP) | ex-TCS (Client Loc: RBS) | ex-CSC | ex-Sapient
1 年Great plugin in AI space, still some improvements needed like not always producing efficient code, adding overhead of cleaning autogenerated boilerplate code, privacy issues (be cautious with sensitive projects), but hopefully will see more advancement in the coming months. Definitely help engineers focus more on critical areas like designing effective project frameworks, generic utilities and performance focused development further. Eventually Copilot is a developer tool, not a developer :)
Simplifying AI for everyone | Phd Candidate - Gen AI | Chief Consultant @Byond Boundrys
1 年Thank you Jyoti for sharing it further.??
Project Manager Data Scientist at Cognizant Technology Solutions
1 年Very detailed and step by step points.
Global HR Leader & Leadership Coach | Transforming Organizations and Teams Worldwide ?? | Expert in Talent Acquisition, Development, and Change Management |Josh Talks Speaker
1 年Keep up the amazing work with Copilot and AI!