August 16, 2022

COSFONE

Networking, PBX, IT, DIY Solution

GitHub Copilot new feature: AI will translate the code to human words?

2 min read

GitHub Copilot new feature: AI will translate the code to human words?

 

GitHub Copilot new feature: AI will translate the code to human words?

It doesn’t matter if you don’t understand the code. GitHub Copilot’s new feature: AI does the kind of translation that speaks human words

GitHub Copilot has a new feature recently. This time, it is no longer writing code for you, but acting as a “translator”: using “human words” to tell you what the code is actually written.

Look, just select a piece of code, and then click “Ask Copilot” next to it, and you will quickly get a “human version” explanation of the code:

GitHub Copilot new feature: AI will translate the code to human words?

 

The code snippet in the example is this:

if len(l)=0: return Noelse: max_int=l[0] for i in l if i>max_int max_int=i return max_int

After Copilot “translates” this, the output is:

Define a function max_int() that takes a list as input.

Set a variable max_int=l[0] which contains the first element in the list.

Set up a for loop that iterates over each element in the list.

If the element is greater than max_int, let max_int equal I.

Return max_int.

 

This is the latest feature of GitHub Copilot – Explain Code. Copilot used to generate code based on human comments, but now it has learned to reverse the output.

 


Copyright © All rights reserved. | Newsphere by AF themes.