Jay Mehta
Version 1
Published in
7 min readFeb 16, 2023

--

How Can Developers Enhance Their Productivity Using ChatGPT and CoPilot?

This article will provide a technical analysis of Open AI’s ChatGPT and Co-Pilot, and discuss if ChatGPT and CoPilot will help reduce dependency on managers, and senior, to help and enhance productivity.

The aim of this analysis is to determine whether any of Open AI’s tools can be used to assist and upskill developers with new projects in areas that are unfamiliar to them in terms of programming language, concepts, and so on.

ChatGPT and CoPilot can bring you up to speed, quickly

We are attempting to solve key issues such as reducing the time spent in tackling a new task, program, or coding language.

Sometimes, due to lack of understanding or experience, developers might find their back to the wall when it comes to certain problems, bugs, or tasks. This could also be due to the fact that understanding prerequisites and learning how to execute programs before moving on to implementation initially slows down productivity, and takes a lot of time. As a result, this creates dependency on a manager, or senior person to solve frequent minor queries.

The benefits for developers in using ChatGPT, CoPilot are, it will reduce the time spent on understanding the code without a frame of reference, it will help find and solve defects faster, and it will provide autosuggestions while writing code, thereby reducing the time taken in testing.

Of course, they have benefits and drawbacks of their own, just like any other tool. They both provide solutions in different ways, but when a developer uses both to advance their skills, they work out well.

ChatGPT

ChatGPT is an AI language model. It engages with users in conversation, so when a user asks a question or prompts the model, the model responds, and the dialogue may then go back and forth, much like when you contact a real person on a messaging app.

Benefits of ChatGPT

· ChatGPT can be used to write simple code in any language, find edges in the code, and ask what this code means.

· ChatGPT can assist programmers in writing higher-quality code by suggesting improvements, identifying potential bugs.

· It can assist programmers in automating repetitive tasks such as code generation and documentation, freeing up their time to focus on more complex and creative tasks.

For example, ask ChatGPT for any code snippets

· The task is to write an Azure function in Python. The first question was how to create an Azure function in Python. This is the response that was recorded.

When asked to create a timer Azure function in Python, the response includes a detailed explanation and code snippets to help in learning.

For example, when asked for a solution to a problem, it will present you with several options from which you can choose based on your suitability.

Ask for explanation of given code snippet

· If you are unsure about something in the code and are unable to identify what it does, we can simply ask this tool for a detailed explanation. As an example,

Ask to find edges in the code

· It helps you to identify where the bug is and what is the root cause for it on providing snippet of code.

Another example,

Limitations of ChatGPT

· This AI cannot design software from an engineering standpoint while considering business needs, nor can it fix errors that differ from those seen in its training data.

· ChatGPT is not all-knowing. It may provide incorrect responses. It will occasionally, and helpfully, warn you of its shortcomings.

· It cannot be used to generate code that requires a lot of contexts.

· It’s accuracy is questionable when you don’t know what the best possible solution will be.

An example of how it became baffled and produced an answer that was not the correct solution:

In this example provided a solution to mention python_version into function app resource block.

Error while implementing this solution:

On mentioning again that this suggested snippet is not working, response is:

If you ask the same question again, another solution with the same context will be generated.

Correct Solution: Correct solution was to mention version in site_config block of function app.

CoPilot

GitHub CoPilot is an artificial intelligence-powered pair programmer that provides autocomplete-style suggestions as you code. It is powered by OpenAI Codex, a new AI system created by OpenAI that is specifically tailored on coding data sets.

You can get suggestions from GitHub CoPilot by either beginning to write the code you want to use or by leaving a natural language comment describing what you want the code to do. GitHub CoPilot analyses the context in the file you’re editing as well as related files and provides recommendations from within your text editor.

Benefits of GitHub CoPilot

· GitHub Copilot provides suggestions for numerous languages and a wide variety of frameworks, but works especially well for Python, JavaScript, TypeScript, Ruby, Go, C# and C++.

· It works as an IntelliSense where it helps in code completion by providing various suggestions.

· It can generate entire code by processing what is the ask from comments in any language with proper documentation reference link as well.

· It can be integrated with various source code editor’s such as Visual Studio Code, Visual Studio and JetBrains IDE.

Generating code suggestions from comments

· For instance, I wanted to create a terraform template for a function app in python.
Here’s how it works.

· Another example would be to write a timer Azure function in Python. It will generate the function with the necessary packages as an import statement, as well as a documentation reference, which is a very nice touch.

· It can also provide you with a quick fix with documentation if you ask for it.

Receiving suggestions while writing the code

· If you are writing code in any language where CoPilot suggests autocompleting, simply press the TAB key. An example,

· It even can give you suggestion for natural messages which are used for logs or exceptions etc. Example,

Limitations of CoPilot

· CoPilot is unable to provide a proper explanation of code that has been suggested or generated. Its purpose is to provide autocomplete suggestions as you type the code or describe it in a comment.

· Because CoPilot has been trained in all languages with public repositories, languages with few or no public repositories may have fewer or weaker suggestions.

· It commonly gives numerous suggestions for document references, and it becomes tedious to keep pressing TAB.

An example: when prompted to create an Azure HTTP function python 3.9, it occasionally erupts with documentation links,

Another example of how it can make weird suggestions like this:

Conclusion

As you can see from this research, each of these tools provides answers in a unique way. While CoPilot is more of a tool (extension) used for autosuggestions and creating code on the fly with documentation and sufficient accuracy, ChatGPT is more of a chat-like interaction with a full explanation.

Our main concern is to use the best solutions to upskill individuals, cut down on development time, reduce dependency and enhance productivity. It appears that ChatGPT is a better fit for our needs. Since it provides a thorough explanation of a query, how it may be done, and allows you to ask additional questions if you are still not happy with its response.

In summary, ChatGPT offers a lot more to help a developer level up with correct code understanding and the use of best practises. It enables developers to understand what went wrong and how it might be fixed without creating any prior dependency.

One may certainly develop their talents and complete tasks on time by making ChatGPT their go-to tool daily.

About the Author:
Jay Mehta is a Microsoft .NET Developer at the Version 1 Innovation Labs.

--

--