In the past month, we’ve seen a whole new sensation take over the web. ChatGPT powered by AI has gained 1+ million users and all of this in just 5 days. ChatGPT is a chatbot that uses NLP (Natural Language Processing) to convert text into real time conversations with humans.
Artificial intelligence (AI) and machine learning (ML) are rapidly changing the way we code and develop software. One of the newest additions to the AI-assisted programming toolset is ChatGPT, a large language model developed by OpenAI. This model can generate human-like text, making it a valuable tool for code generation and documentation. Another tool that’s gaining popularity is GitHub Copilot, which can help developers write code faster and more efficiently.
In this blog post, we’ll explore how these two tools can be used together to enhance the programming experience and achieve faster time-to-market.
ChatGPT can be used to generate code snippets, complete functions, or even entire programs. It can also be used to generate documentation, comments, and explanations for code. This can save developers a significant amount of time and effort and can also improve the quality of the code by reducing errors.
Here’s an example of how I used ChatGPT to assist in programming where I’m asking ChatGPT to create Products microservice using Asp.net Core and C#.
The following results were generated by ChatGPT.
General overview wasn’t good enough for me. So, I instructed ChatGPT to “Write code for Product model and Products Controller” and the code was generated as shown below:
It also created a set of comments as shown below. If there are algorithms generated, it provides detailed comments about the program.
Now, I want the products to be retrieved from a products service instead of a static list of products. I instructed ChatGPT to get products from a products service.
This can go on and on in a conversational manner. You get the idea.
GitHub Copilot, on the other hand, is a code completion tool that uses machine learning to predict what you’re going to type next. Copilot harnesses the power of OpenAI’s generative pre-trained language model, codex to suggest code and entire functions in real-time, right from your code editor such as Visual Studio. With Copilot, you can write code quickly and efficiently. Copilot uses context from comments and code and immediately suggests individual lines and whole functions. The product was also trained on natural language text and source code from several publicly available sources, including GitHub’s public repositories. It can also suggest and complete entire lines of code, making the coding process faster and more efficient.
Using these two tools together can enhance the programming experience by reducing the time and effort required to write code, and by increasing the quality of the code. The combination of ChatGPT’s ability to generate code and documentation with GitHub Copilot’s ability to predict and complete code can make programming more efficient and less error-prone.
One of the most important things to remember about ChatGPT is that it’s not here to replace developers. Instead, it’s here to be a conversationalist that helps developers boost their productivity by providing them with helpful information that they wouldn’t otherwise have access to. ChatGTP does this by building on the conversations developers already have with each other, and adding in context-relevant information from a variety of sources. For example, in the event of an error, ChatGPT can provide more context-specific information about what went wrong than you would find on StackOverflow or Google.
Marlabs created “Code Craft”, which is an accelerator that can generate code and unit tests based on pre-defined models and templates. Code Craft now harnesses the power of AI-assisted programming using ChatGPT and Github Copilot to accelerate application building and unit testing by 45%.
AI-assisted programming is a trend that is here to stay. Tools like ChatGPT and GitHub Copilot are leading the way, by saving developers time and effort in writing code. These tools can improve the quality of the final product, and will likely become more and more common as time goes on. In conclusion, we can expect to see more and more AI-assisted programming tools in the future, which will combine to make our programming experience even better than it already is.
About the Author
Senior Director and Head of Microsoft Practice at Marlabs.
Ajil Antony is Senior Director and Head of Microsoft Practice at Marlabs. With over 20 years of experience in the IT industry, he has spent 15 years in the US and UK working consulting for global leaders such as Pfizer, Deloitte, Merrill Lynch /Bank of America, McKinsey, McGraw-Hill, Verisk Analytics, United States Golf Association and Ladbrokes. His core focus areas include Digital Transformation, Enterprise Architecture, Cloud Computing, Web Content Management, Data Analytics and E-commerce.