GitHub Copilot: Make development and programming as easy as speaking

Quote:

Human beings are born to dream, create, innovate. But today, we spend far too much time being consumed by heavy workloads, spent on tasks that drain our time, creativity and energy. To reconnect the soul of our work, we need not only a better way of doing the same thing, but a new way of working.

image.png

Foreword:

Recently, with the implantation of GPT-4 into the Office family bucket, PPT and Excel documents can be made in a few seconds, and office software applications are seamlessly connected, freeing hands at work. I have to say that it is really strong! Can you still eat? I lament that there is such a huge knowledge base and computing power behind it to support it! When we are still immersed - will the traditional way of working be subverted eventually? In the field of R&D and programming, the birth of GitHub Copilot , the right-hand man of developers and engineers , must have made us sincerely admire how powerful it is!

Case scenario application:
image.png
As we all know, GitHub code warehouse and code scanning tools such as SonarQube have the shadow of ES. It is of great significance to assist R&D in code management, version diff, and potential problem scanning and inspection!

image.png

The above is the effect of SonarQube doing CodeReview, this pseudo-code has the famous BUG null pointer! ! !
Instead of AI tools, let's take a look at how ChatGPT adapts to the situation? It can be seen that ta is quite satisfactory in the following answers, "answers with wisdom", it is obvious that the context is very relevant! ! !

image.png
image.png
Let’s briefly try the ordering method and algorithm here, such as the familiar data structure algorithm, quick sort, bubble sort, binary search... translate it
Translate, I'll know right away
, and you will know it immediately

It can be seen that AI can assist our developers to automatically complete code blocks, single methods, and functions, and automatically generate executable code fragments according to code comment prompts.

Using the integrated development environment of Microsoft Visual Studio, Vim, Visual Studio Code, and JetBrains, the Copilot tool undoubtedly greatly improves the productivity of the majority of developers, saves the time for research and development, and greatly improves the efficiency of research and development.

image.png

This note will be an epoch-making product. With the continuous expansion of OpenAI training data sets and targeted training of various development languages, it will surely bring greater breakthroughs in many vertical fields and help developers increase programming speed. Raised to incredible levels.

Let's also integrate it into the actual project, and then some examples:

Then let Copilot help us encapsulate a websocket.js for connecting to websocket...
image.png

From the above, we can see that AI provides us with a variety of solutions for reference. In such a short period of time, your prompts have undoubtedly become the medium of AI tools with great productivity, especially when you need to retrieve data, especially for SQL or DSL scripts that cannot be written, you can use Copilot , which not only reduces the time spent on google, but also helps you complete and improve related matters, improve the efficiency of software development and job satisfaction, this will be a transformation from traditional programming to intelligent and conscious thinking mode...

image.png

As OpenAI's GPT-4 model continues to evolve, its capabilities are far from that, and there are many more features that are worth exploring - a powerful partner at work, especially integrating it into various parts of our developer workflow. For example, like the management of our developer's Git code warehouse version in TFS-team collaboration:

In the maintenance process of a large open source project, standard submission (PR) is extremely important to our developers. A good PR description can not only make code review staff clear at a glance, but also help reviewers quickly understand Code changes. While improving communication efficiency, it also reduces the possibility of errors during the merger process.

extend:
image.png

When our developers create a pr, if AI can mark and dynamically extract the code, analyze the code change information, and help us automatically generate descriptions and suggestions, so that our developers can view or modify the suggested description.

When our developers create a pr, we find that the submission lacks enough tests. If AI can intelligently remind our developers, and give a solution strategy, assist the review staff to solve the problem and fix the bug.

This undoubtedly reduces the time cost in the code review process. At present, developers generally look up relevant documents through search engines. AI has changed the way and habits of people to retrieve information at the same time. In this way, we need to communicate more accurate information with AI-prompt words.

Summarize:

Indeed, in the DT&AI era, the emergence of innovative AI products undoubtedly brought a huge impact to developers. However, as developers, we should face it with a positive attitude, embrace technology, improve our own knowledge and skills, learn to use and use tools, so as to better adapt to the development of technology.
image.png
1. Register a GitHub account

image.png

2. Apply for trial

image.png

3. Install a code editor

image.png

4. Install the GitHub Copilot plugin

Take Visual Studio Code as an example (download -> https://code.visualstudio.com)

image.png

Then, enter the Extensions panel, enter the Enter key in the search box, find the plug-in in the search results and select the corresponding plug-in and click Install, as follows:

image.png

Then, after the installation is complete, click the GitHub Copilot icon in the status bar at the bottom of the tool to enter GitHub Copilot, and you can choose to log in with your GitHub account. In the process of using the GitHub Copilot plug-in, as in the example we gave above, that is, enter keywords in the editor or the prompt statement you want to achieve the effect, GitHub Copilot will automatically appear a prompt box, and we can choose one of them The code is suggested, or you can continue to input prompts to get more suggestions we want. Of course, you can also manually edit and correct the code to achieve our expected results.

At the end of the article, here Copilot also provides some shortcut keys and usage skills:
image.png

Guess you like

Origin blog.csdn.net/yxd179/article/details/131959367