Far ahead! Discover the magic of Amazon CodeWhisperer, your personal AI programming assistant!

Insert image description here

【Foreword】

With the popularity of artificial intelligence technology this year, more and more fields are accepting and utilizing this powerful AI technology to achieve more efficient and smarter ways of working. In the field of software development, AI technology has brought unprecedented changes to our work. From automatic code generation to intelligent programming assistants, AI is gradually changing the way developers work, improving development efficiency and code quality.

For traditional programmer development, to complete some business logic code or specific code, you need to manually type the code from scratch, check bugs, find ideas, and do optimization. This process requires more time and energy to complete. But today, times have changed.

Amazon Cloud Technology has launched a cutting-edge AI programming assistant- Amazon CodeWhisperer . This tool utilizes the most advanced deep learning technology. By training billions of lines of code, it can quickly understand developers' needs and provide instant and powerful code suggestions and error detection, allowing developers to work faster and more safely. Build the application.

In order for friends to better understand and master Amazon CodeWhisperer, in this blog, I will take you to experience the magic and power of Amazon CodeWhisperer step by step! Let you fall in love with Amazon CodeWhisperer and use Amazon CodeWhisperer~!

Insert image description here

1. Overview of Amazon CodeWhisperer functions

Maybe many friends are not clear about the specific capabilities of Amazon CodeWhisperer. Here I will give you a detailed introduction to some of the super practical and powerful functions of Amazon CodeWhisperer! With these functions, you no longer have to worry about being criticized by colleagues for your development efficiency!

1.1 Powerful code suggestions

Amazon CodeWhisperer is trained on billions of lines of code, so it can understand a variety of codes written in natural language and can generate multiple code suggestions in real time to improve developer productivity. The service provides suggestions for complete functions and logical code blocks (typically consisting of up to 10–15 lines of code) directly in the code editor of the integrated development environment (IDE).

And don’t worry that the code it generates does not conform to your coding style. Amazon CodeWhisperer will learn your code writing and style and follow your set style and naming rules. How about it? It’s amazing!

1.2 Support multiple languages ​​and IDEs

In company development, the language or IDE developed by each programmer may be different, but don't worry.
All types of mainstream development languages ​​currently on the market, such as Python, Java, Go, Rust, PHP, C++, C, JavaScript, TypeScript, etc., are all supported! And supports various mainstream IDE tools, including IDEA, Pycharm, VS Code, etc.~

Some friends may ask, what if it is SQL Boy? Can I use Amazon CodeWhisperer? My answer is, that is a must!

1.3 Security Scan

After we write the code, we can use Amazon CodeWhisperer to help us perform security scanning of the code. Amazon CodeWhisperer will help us analyze the code vulnerabilities, and will propose changes and optimization suggestions and code for the vulnerabilities in our business code.

This function is very practical and can help us eliminate unnecessary safety hazards! Boss no longer has to worry about problems with the code I write.

2. Immersive experience using Amazon CodeWhisperer to develop code in practice

I believe everyone is looking forward to the actual performance of Amazon CodeWhisperer after seeing this. No, let me show you how Amazon CodeWhisperer intelligently helps us improve learning and work efficiency in our daily lives!

First, we use Amazon CodeWhisperer to help us quickly build some common algorithms and codes. Here I choose the Python language to see how Amazon CodeWhisperer helps us build it!

2.1 Quickly import Amazon CodeWhisperer into Pycharm

First, we find the plug-in in Pycharm's Settings, and then search for "Amazon Toolkit". Click Install, wait for the download to complete, and then restart Pycharm~

Insert image description here

Then we further process it in the plug-in and use a personal AWS account to use Amazon CodeWhisperer~

Insert image description here

We need to paste this code in for verification! And follow the subsequent operations to register your email and create an AWS Builder account~

Insert image description here

A pop-up window will appear after everything is ready~

Insert image description here

When the following interface appears in Pycharm, it means that we can use Amazon CodeWhisperer smoothly!
Insert image description here

Without further ado, let’s start using it!

2.2 Use CodeWhisperer to quickly build Python code

Let's first use Amazon CodeWhisperer to write a simple bubble sort and see the effect. First enter our comments so that Amazon CodeWhisperer knows what we are going to do. Then we enter import and we can see that Amazon CodeWhisperer automatically completes the random function for us.

Insert image description here

Seeing the picture above, do you think Amazon CodeWhisperer is just as simple as filling in a line of code? I can only say that you underestimate Amazon CodeWhisperer! Then read on!

Insert image description here
Not just that line! Amazon CodeWhisperer can simply and directly help us complete all the implementation codes!

Okay, here I choose the code completion in option 2, and then when the input character reaches the last line of the code, a new line automatically pops up!

Insert image description here

That is to say, the line print(a[i],end = ' ') was automatically prompted by Amazon CodeWhisperer if I needed to add it without me giving any instructions! If I need it, I just press the Tab key or click the Insert Code button with the mouse.

What can I say, brothers, have you ever felt like taking one step counts as three steps! This is different from previous AI code assistants on the market. Amazon CodeWhisperer can truly assist you in writing code through "prejudgment"! And everything we started with just "came from" an inconspicuous little comment. Amazon CodeWhisperer has helped us calculate the next 2-3 steps through this comment. Isn't it very efficient!

I tested the time it takes to write bubble sort using Amazon CodeWhisperer, and I only need to press the Tab key three times! That’s about 2 seconds! If you write normally and only use the code Tab that comes with Pycharm, it will take about 15-20 seconds no matter how fast you are!

Compared with 20s, 2s has a nearly 10 times difference in time cost. I don’t need to say more about how useful it is in daily development. Dear experienced drivers, time is money!

It can only be said that Amazon CodeWhisperer truly helps developers save time, and the user experience is at its best!

Among its peers, Amazon CodeWhisperer can really be said to be "far ahead" hahahahaha.

In addition to the **"predictive" speed advantage** highlighted by Amazon CodeWhisperer above, Amazon CodeWhisperer also has another advantage, that is, Amazon CodeWhisperer not only provides you with one code idea, but also provides more than 3 types of code suggestions. , giving us a variety of choices!

Obviously, we can make choices based on our specific code development needs and personal habits, which directly maximizes the personalized experience~~~** It is simple, fast and easy to get started, and there is no difficulty at all! I wonder who hasn’t used Amazon CodeWhisperer yet hahaha.

2.3 Amazon CodeWhisperer supports code writing in various fields.

Some veterans may think that the above example is too simple, or they are not satisfied with the super magic of Amazon CodeWhisperer.

Okay, let’s get some “high quality” stuff.

The situation is like this. Two days ago, a classmate of mine who was still in graduate school was participating in the National Graduate Mathematical Modeling Competition and asked me how to use python to write some efficient mathematical algorithm models, such as two-dimensional Markov chains. , I was checking here and there, piecing together a code for a two-dimensional Markov chain algorithm model to my classmates. I can only say that the thirty or forty lines of code took me at least two or three hours, and it was very uncomfortable and tiring to do.

Now I use Amazon CodeWhisperer to try to see how long it takes, or whether it is difficult to write the algorithm model.

First, write a comment as above to let Amazon CodeWhisperer understand what I want to do.
As you can see, as shown in the picture below, I simply entered import math, and Amazon CodeWhisperer has already helped me complete other common mathematical calculation packages needed.

Insert image description here
Next, I continue to write in the notes what I need to do. For example, I want to continue writing a state transition equation to find the probability matrix of the Markov chain model.

Insert image description here

As you can see, Amazon CodeWhisperer directly provided me with an initial matrix, which is very convenient.

We can make further requests, just write them clearly in the comments.

Insert image description here

After the completion, the next step was Amazon CodeWhisperer, which helped me make code suggestions based on the new comments. Does it look very professional? The code style looks pleasing to the eye, very neat, and refreshing.

Insert image description here

Then we simply judge the state matrix and return it. The code suggestions from Amazon CodeWhisperer are as follows.

Insert image description here

How about it? Isn't it very good? In just three to five minutes, it can help me outline the architecture of this algorithm model, which can save me a lot of trouble.

This shows that Amazon CodeWhisperer can really cover many scenarios. Even for advanced mathematical knowledge and data science codes, Amazon CodeWhisperer can help us complete the writing!

On the basis of being simple and easy to use, what we are saying is that Amazon CodeWhisperer is an all-rounder that can cover the needs of multiple fields and directions~

2.4 Amazon CodeWhisperer’s security scanning function

I found a reference sample code for graduate student mathematical modeling. According to convention, there should be no problem with the reference sample code. Let’s see if Amazon CodeWhisperer’s security scan will suggest any security vulnerabilities~
Insert image description here

Insert image description here

We can wait patiently to see the scan results. The results show that everything is normal during the scan, which means there is no problem with this reference sample code. This is in line with our expectations, indicating that the security scanning function of Amazon CodeWhisperer is still fine~

Insert image description here

3. Summary of Amazon CodeWhisperer

After reading so many things mentioned above, I believe all you veterans must be very excited. What are you waiting for? Start using it now!

Let’s summarize the advantages of Amazon CodeWhisperer:

1. Friendly to beginners, there is no difficulty in introducing it. As you can see, it takes about two minutes to import and use Amazon CodeWhisperer. It is very simple and does not take much time.

2. Easy to get started. In fact, there are only a few shortcut keys to use Amazon CodeWhisperer, such as Tab, which is not difficult to use at all.

3. Wide coverage and comprehensive functions. We can see that he can also quickly give code suggestions for some advanced mathematical knowledge. This is actually very good, because we will encounter various problems and needs during development. The comprehensiveness of the code assistant determines whether it can help more developers, so I think Amazon CodeWhisperer is very excellent, and its functions Comprehensive and no blind spots.

4. Maintained code development security. Maybe many developers who have just worked for a few years are not very experienced in code security, but Amazon CodeWhisperer can just help us effectively identify and fix potential security vulnerabilities, which I think is very good. Help us complete code development better.

To sum up, I think Amazon CodeWhisperer is a very good AI code assistant in all aspects. It is far ahead of these four words and definitely deserves the title!

Click the hyperlink below to jump directly to the official homepage of Amazon CodeWhisperer! ~ CodeWhisperer jump to official website

Insert image description here

Guess you like

Origin blog.csdn.net/weixin_51484460/article/details/133386799