The AI chatbot ChatGPT has become mega-popular in just weeks, faster than social media platforms like TikTok or Instagram. Only two months after its launch in late November, it had 100 million monthly active users in January. You probably heard that ChatGPT is at the moment the “must-have tool” for marketing teams or guest writers.
But how can ChatGPT speed up your daily work as a developer?
In this article, I describe some examples of ChatGPT usage from real programmers' cases. Usually, I'm programming in JS with TypeScript, so the examples will be on this stack. The theses presented in this article are subjective. Nevertheless, I would like to explore the possibility of using AI daily.
The first use case is the following:
I would like to set up a new project for the AWS lambda function. It has to be written in TypeScript and based on the AWS CDK. Let’s see, what is a ChatGPT proposal:
To create an AWS Lambda function in TypeScript based on the AWS CDK (Cloud Development Kit), you can follow these steps:
That's it! You should now have a TypeScript-based AWS Lambda function up and running, deployed using the AWS CDK. Note that you may need to configure your Lambda function's runtime to use Node.js 14.x or later to support TypeScript.
The above content has been generated from ChatGTP. We have a complete guideline step by step how to create/set up the project with AWS lambda based on the CDK. This is absolutely awesome! Obviously, it’s probably not a super optimizable setup but usually, it depends on use cases.
However, for me, it could be a good starting point extended in the future. The effort is absolutely minimum.
Let’s define the next problem:
I would like to get a list of the most popular IVR providers. The AI response is like the below:
There are several IVR (Interactive Voice Response) providers available, each with their own set of features and pricing plans. Here are some of the most popular IVR providers:
These are just some of the popular IVR providers available. When choosing an IVR provider, it's important to consider factors such as pricing, features, and ease of integration with your existing communication systems.
So we can reduce a lot of time and instead of researching the information by ourselves - just asked the ChatGPT. Is it not awesome? But can we try to check the proposal for the IVR implementation?
I would like to implement the IVR using Pivo in TypeScript. Here is a result of that question:
Sure! Here's an example of how to implement a basic IVR (Interactive Voice Response) system using Plivo in TypeScript:
That's it! This is a basic example of how to implement an IVR system using Plivo in TypeScript. You can customize the messages and actions to suit your needs.
Again the generated content looks quite nice. It’s a completed tutorial step by step how to start the implementation of the IVR based on the specific library. Obviously, you still need to check the documentation of the Plivo SDK but it can be a good starting point again.
Let’s check the example such as:
This function goes from the helpers and is using to calculate the nights between two days. The bot response looks like the below;
Sure, here are some unit tests for the calculateNightsBetween function:
Some of the use cases have been covered. Also, the detection of the LocalDate was correct. The examples of the function hadn’t had information on what kind of library has been used LocalDate, but the chatGTP deducts it perfectly.
The problem was the following:
Please add variants when one of the variables is undefined, null or empty.
And again the response was quite nice:
Sure, here are additional tests to cover scenarios where one of the variables is undefined, null, or empty:
Based solely on my opinion, I am inclined to assert that AI can be used in a programmer's typical day-to-day work. The examples I presented only show a fraction of the spectrum that we can utilize based on artificial intelligence, while also saving a lot of time. We must always remember that our problems often concern very specific issues, and therefore, the generated solution may not meet our expectations. However, AI should become one of the basic tools for a programmer, such as IDE or Stack Overflow.
We must always remember that our problems often concern very specific issues, and therefore, the generated solution may not meet our expectations. However, AI should become one of the basic tools for a programmer, such as IDE or Stack Overflow.