ChatGPT for programmers
Shantanu Shukla
Software Engineering Manager | Building High-Performance Teams | .NET | Microservices | AWS Azure | DevOps | Application Security
Many people say chatGPT will take away the job of programmers. Believe that's not going to happen. Let's take chatGPT as your assistant rather than a competitor.
The art of questioning
The first and foremost trait here is the art of questioning. I have seen people complaining that they do not get correct answers. Be aware that chatGPT is an AI-based chatbot. The information we receive is only as accurate and helpful as the question we ask. Ensure that questions are concise, clear and specific so that AI can understand what we want.
Here are some good & not so good examples
How ChatGPT can help you in programming?
Now that you have understood it from a basic view, let's understand it from a programmer's point of view.
ChatGPT can help you to write and refactor your code, can suggest comments for methods, write unit tests for you and a lot more.
You can ask it to write code for you, the only condition is that your questions should be framed correctly.
Not so a good question
Create an employee class.
ChatGPT response
领英推荐
Specific Question
Can you create a class Employee with 4 properties
EmployeeId, Name, ContactNumber and DateOfJoining.
The class should also have 3 methods to create, update and delete employees.
The class should be CLS-compliant and must have an XML summary for
all the methods.
Chat GPT Response
Now you might have noticed that with a very specific command, we are able to exactly get what we want. Imagine if you had to write this code on your own, you must have at least spent 15 minutes with possibly a few typos in the XML summary.
Question 3 - Asking to write test cases
Can you write 5 test cases for following code
public int Divide(int a, int b)
{
return a / b;
}?
ChatpGPT response
Summary
We've seen that AI chatbots can help us to write, understand, and refactor code. They can help us to populate the comments and XML summaries.
There is Visual Studio extension is available too which I will explain in my next topic. For now: Adios!!!
Questions must be:
* Clear
* Concise
* Specific
* Provide sufficient inforamtion
ChatGPT capabilities:
* Can explain complex code in simple terms
* Can suggest performance bottlenecks
* Can write test cases
* Can optimize your code
* Rewrite code in another language
Senior Java Consultant
1 年Thanks a lot, this was very useful
BPO Client Servicing Strategic Leader??Call Center Training Operation Expert??Content Design & Development Specialist
1 年Thanks for sharing Shantanu Shukla
Transform Your Financial Future Today! I empower salaried professionals with personalized retirement plans, proven equity strategies, and expert mutual fund guidance. Book your 1-on-1 session now, Live Your Dream life!
1 年Grt insight on how to use ChatGPT Shantanu Shukla
Assisting businesses with their digital footprint improvements through Digital transformation | Process reengineering | Automation | Artificial intelligence , to help them achieve their business goals
1 年very useful article
?? Pioneering Digital Transformation & IT Automation | ?? AI & Data Science Advocate | Catalyzing 30%+ Business Growth with Agile Leadership & Program Management | ?? PgMP?, PMP?, SAFe?, ITIL?
1 年Thanks for the post. Please note that while ChatGPT can be helpful for programmers, it is important to verify the accuracy of the information and suggestions provided before implementing them in your projects. Always consult official documentation and other trusted sources to ensure best practices are being followed.