Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Jesús Almaraz blog / Git Copilot: the first five...

Git Copilot: the first five minutes

Jalmaraz Profile Picture Jalmaraz 669

Note for new Medium readers

I published this post half and a year ago. I was in a hurry to explain how good was my first impression of the tool was. In fact was my very first impression, my actual five minutes with the tool. From that moment Co-Pilot has become my workmate, when I made JavaScript extensions. I promise that I will write an updated post about working with Co-Pilot and publish it in Medium at the same time as in Business Central blog.

Why first five minutes?

The logic position in tool previews, is taking your time, make a lot of tests and write about it. I will do it. But I want to catch my very first feelings and write them. I do it because it has been a very short but significative time. So I stopped, wrote this, and later I will keep working with it for further knowledge and share it, if it is worth of it. I thought it is a very crazy idea and the straight way to a further post saying the opposite to this text, but in the other hand this could be more unusual in a subject that I came late, as usual because I am not an early adopter, and there are many posts about it, including in the BC world. This not a change of style in this blog, only an exception.

JavaScript

Let´s go with JavaScript. Straight to the matter. I typed this:
function ShowConfirmDialog
And I got this suggestion from Copilot:
function ShowConfirmDialog(message,context)
{
  vscode.window.showInformationMessage(message, 'Yes', 'No').then(selection => {
    if (selection === 'Yes') {
      ShowStepHTMLView(context);
    }
  });
}
I accepted because it is almost exactly that I tried to do. It is hard to explain how good this is, so I go to break down it. From the name of the function, the suggested code gave me all this:
He infers by the context that I am building a VSCode extension, and suggests a dialog method from vscode api, the right method with the right parameters. The show information message method is (very) polymorphic and it chooses the right parameter set for confirmation dialog. It knows too that is an asynchronous method, and make the promise handle to the method, with “then” statement. In this promise it  includes the call to my own function ShowStepHTMLView.  It is a strange coincidence, but I want to use this function inside the promise resolution. I feel that Copilot has its learning background from other repos code, but it examines the current code to add elements from my code.
So far the good news, here it comes the AL language part.

AL

The smart guy disappears when we start playing with AL. When we use Git Copilot, we see a few very few highlights, but the result does not impress. The most predictable routines we made in our daily work(filter a sales line from a sales header and repeat until the last line) can´t be solved by Copilot, despite we wrote this code thousands and thousands of times. Most of the suggested code can´t be compiled: lot of suggest variable types and statements does not exists in Al language.
The explanation is that there are much more lines of code in JavaScript than in AL language in GIT repos. The lines of code are the source of knowledge to train GPT-3. If you want to read about the basics of machine learning you can check this link Machine Learning for programmers - Dynamics 365 Business Central Community.
But in my opinion we must ask for more: GPT-3 it´s an outstanding learning system, and we make a lot of predictable code, that we must stop writing.

Conclusion

More than a tool this could be our pair programming partner but bring it to BC AL people too please!!!

Comments

*This post is locked for comments