Empower your code: How Microsoft Copilot transforms software development

September 28, 2024

Written by our Software Engineer and First Line Software Ambassador, Hazir Nurkovic.

Boost your productivity: Let Copilot handle the routine, so you can focus on innovation

Software development requires deep concentration, problem-solving skills and so much patience.

It can be a challenging job, and often during working hours, it truly is. But is there any better feeling than finally cracking a problem you've been stuck on, and seeing your code run error-free?

As I said, being a developer requires a lot of patience. We've all, at least once, experienced that frustrating moment when you run your code only to encounter a confusing error. Then, after hours of debugging, you realize it was something as trivial as a missing semicolon or a similarly small mistake.

But, (un)fortunately, thanks to AI-powered tools like Microsoft Copilot, developers can now take their coding experience to the next level. We can now focus on innovations, new modules, new ideas to the project, and leave the AI tools handle the routine, syntax problems and for example missing semicolons.

From automating repetitive tasks to suggesting smart code snippets, Copilot serves as a powerful companion in your development environment.

Revolutionizing development with AI

I hate to admit it, but I can’t imagine a workday without using some AI tool. Even though the AI craze is still relatively new, it has quickly become ingrained in our daily routines. Suddenly, we can’t picture our lives without it and it’s now a cornerstone of innovation across industries.

In software development, whether you're writing PHP, JavaScript, Python, or any other programming language, AI can be very helpful. For example, Microsoft Copilot assists you in real-time by suggesting code completions, refactoring code, or even writing entire functions based on your inputs. It's like having an expert by your side to guide you through coding challenges.

Another AI tool that I suppose all of us at least heard about is ChatGPT. It can also be helpful for developers to explain a specific part of the code (especially if you are new to a team or project), to propose some solution for the problem, explain  some generated errors you may encounter, and so on.

Microsoft Copilot – How to install and use on VS Code

Setting up Microsoft Copilot is very straightforward and easy. Here are the steps:

1. Open VS Code.

2. Go to the Extensions tab, and search for GitHub Copilot.

3. Click on it and then click Install.

4. After that, click the GitHub link to authenticate your GitHub account with Copilot.

In this process you will be asked for your bank account credentials in order to buy Copilot. Just be aware that the first month is free to use.

After you completed all of the steps above, you are ready to use it. Since I recently started learning Python, I will demonstrate some simple examples of using Copilot. I have created some .py file.

As you can see, Copilot already gives me instructions for how to use it. If I press Ctrl + I, and type something like:

“list of 5 elements: "Item1","Item2",...” it will automatically generate a list with 5 elements:

Also, we can use comments to activate Copilot.

For example, we start writing comment on what we want to create:

As soon as I started writing “# func”, Copilot gave me an suggestion for what to do next. If I click Tab, the comment will be written by the end if I agree with the proposal. Then, if I click Enter, I will get so-called “Ghost Text”, which represents Copilot's suggestion for my code according to the comment above:

Again, if I like what Copilot offered, I can click the Tab button and the whole function will be written for me.

If I don’t want to take the whole code from Copilot, but maybe get a definition and name of the function, I can simply hold CTRL and click Right Arrow. It will take us part by part, following our Right Arrow clicks. So with the first Right Arrow click, it would mark “def” as it’s been written. Then if I click Right Arrow again, it would do the same with print_list(): and so on.

It’s awesome and astonishing how this can accelerate our development!

Next, if I want to write a function that will print odd numbers between two parameters (start, end), I would begin writing: “def printOddNumbersBetw”  and the magic happens:

Again I receive suggested “Ghost Code.” Repeat the same process. If I like the solution, I will just click Tab and I will have the whole function ready for use.

If I want to take some things from it, I will press CTRL + Right Arrow until the line where I want to start coding myself.

These are just a few basic things Copilot can handle. So, what do you think? I’ve always wanted an assistant tool that could complete my coding thoughts, and now it’s finally here. No more writing out every little thing—this "guy" can handle it for me!

Conclusion: Let AI handle the busywork

In a world where developers are expected to juggle countless tasks and technologies, Microsoft Copilot is an invaluable tool. By helping you write cleaner, more efficient code, it transforms your daily workflow and frees up your brainpower for the bigger challenges. Whether you’re a seasoned developer or just starting out, incorporating Copilot into your toolkit will change the way you code for the better. So, why not start today? Revolutionize your coding experience and discover the power of AI with Microsoft Copilot!

About the author

Hazir Nurkovic is an FLS Ambassador and Backend Developer who is passionate about all things technology, programming, and video games. Offline, Hazir enjoys nature, hiking, and sports.

Let’s talk!

Have any questions? Fill out the form and our team will be in touch!