Top 10 ChatGPT Prompts That Will Boost Developers Productivity

ChatGPT Prompts

In the world of AI, increasing your productivity using tools like ChatGPT is essential. ChatGPT prompts helps to extract results efficiently. This prompt acts as an optimizer for your questions. Every LLM has well-trained prompts, on which it could give the most accurate results. We have the collections of such prompts to boost your productivity.

ChatGPT Prompt’s

1. Write the Code

Re-write the 'fetchUser' function based off your review and recommendations.

Tell chatgpt to create a function with the name based on the review and the recommendations you provided.


2. Give me alternatives

I'll provide you with a piece of code that I made and 
I need you give me alternatives to do the same in other way:

[INSERT YOUR CODE HERE]

Provide a code snippet to get the alternatives based on the code provided. It will give you all the possible alternative ways to do same thing.


3. Generate Documentation

I don't know how to code, but I want to understand how this works. Explain the following code to me in a way that a non-technical person can understand. Always use Markdown with nice formatting to make it easier to follow. Organize it by sections with headers. Include references to the code as markdown code blocks in each section. The code:

[insert code here]

One of the most used prompt of ChatGPT. It will help you to generate documentation for you code without knowning the logic. Generating documentation is hard for newbees. This prompt generates step-by-step guide and create a markdown file. Include headers and take references from code and the previous data available in LLM.


4. Explain code

Context: I'm starting a new position as backend developer and I have to start to understand how some functions are working
Technologies: [INSERT YOUR TECHNOLOGIES HERE]
You have to: explain me the code line by line

[INSERT YOUR CODE HERE]

Increase you productivity by firing this prompt. This prompt will give the detailed explanation of the provided code. Save you time and focus on the main problem. You may asked for more optimized code as well. No matter what programming language is. Just paster it and get explanation.


5. Migration from old code to new code

Refactor the following code to modern es6 programming standards:

[INSERT YOUR CODE HERE]

It will convert legacy code to modern and latest code version. You can specify the exact version as well. Also you can do vice-versa i.e. converting new code to old code.


6. Code Optimization

Refactor the following code to improve performance:

[INSERT YOUR CODE HERE]

This prompts optimize the give code. Provide the edge cases and the design styles to follow. Many developer use this prompt when actual development is completed. Although it will not always provide optimize code, but you will get a key points to optimize code.


7. Debug and fix issues

Review this code for errors and refactor to fix any issues:

[INSERT YOUR CODE HERE]

It can debug any type of code and fix it according to coding style. Sometimes we unaware of the potential bugs in the code. ChatGPT can easily detect such vulnerabilities and fix it with best approach possible.


8. Create a function for project

Context: I'm creating a software to manage projects

Technologies: Go, PostgreSQL

Description: It's a function that let me find users by its email or username.

You have to: create the function for me

It will create a specific function for you project. It will follow coding style and write a logic. It will write end to end logic for the function. Explaining the detail use of generated code and where to use it.


9. RegEx

Write a regular expression that matches / Write a RegEx pattern for:

[REQUEST]

Generate RegEx to detect a pattern in a given text. We oftern use regex to validate emails and praswords. It is a powerful tool if used correctly.


10. Create Boilerplate Code

Write me a boilerplate Node.js function that will take a variable of type User, validate that the user has the right permissions, fetch an array of item type Posts from a postgres database and return them. Leave comments for business logic.

Specify the language, functions and the basic logic to genrate boilerplate code. It will write a code from scratch. It is painful to generate code from scratch. Even if the ChatGPT don’t know your business logic, it will generate code.


Also read, How to become a backend engineer?

Also share on

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *