10 UseFul ChatGPT Tricks to 10X your Coding Speed
Tricks and Hacks that I Use Every Day in ChatGPT
I’ve put together a list of useful tips and tricks I use — when trying to code something completely in ChatGPT.
This is also a reminder and a guide on the steps to take when things go wrong— it helps me troubleshoot and build faster.
This guide is for beginners and pro coders. It should help anyone build faster with ChatGPT.
These are 10 important ideas — not in order of importance.
If you want to learn more AI tips and tricks to help grow your business and earn more money online:
👉 Sign up for our free 5-day email course to grow 🚀 and earn💲👈
This guide is especially useful for web programmers that often use API’s and LLM’s to build small applications and MVPs.
1. Debugging Assistance — Error Log
Prompt:
“I’m getting an error in my code: [insert code snippet]. The error message says ‘[insert error message]’. Can you help me fix it?”
Example:
Usage:
When you get an error, give ChatGPT the code snippet and the exact error message. The AI can help identify the issue and suggest a fix, saving you time and frustration.
It might take you a few iterations of this also. So get ready to copy and paste a few bugs from the error log — multiple times.
Just cut and paste the whole log also. Even if you don’t understand it.
2. Code Optimization
Prompt:
“Here’s my code: [insert code]. It works, but I think it can be more efficient. Can you suggest improvements?”
Usage:
Use this prompt when you suspect your code isn’t as efficient as it could be. ChatGPT can provide optimized versions or suggest better algorithms.
3. Cut and Paste Documentation
Prompt:
“Here is a more up to date documentation for [api name/version] and also the documentation [url]. But I will cut and paste a full example [here]. Update my code with the new API version.”
Usage:
When you get errors from ChatGPT — it is often because API versions are out of date. If you give the url of the documentation, ChatGPT often doesn’t read it.
It is better to cut and paste the entire code or working example to tell ChatGPT how to do it.
This can save hours of headaches — I know this firsthand.
4. Code Translation Between Languages
Prompt:
“Convert the following code from [language A] to [language B]: [insert code].”
Usage:
This is helpful when you’re more comfortable in one language but need code in another. ChatGPT can translate code while maintaining functionality.
5. Backup and Label ALL Versions
Usage:
If you are getting AI and ChatGPT to help with coding. Always backup and label your versions! I can’t tell you how many times, ChatGPT changed something and broke my software without me knowing.
Also, document which versions you have actually tested and are working.
6. Pinpoint Issue — Break the Problem Down
Prompt:
“My code isn’t working [insert code]. Can you first get the part working and make a log of this to show it was successful? Also, make a log of each step to find out where I’m getting an error [describe functionality]. Can you help me write it?”
Usage:
This is perfect for pinpointing the issue — create a smaller test first to see why the app isn’t working. If you are testing a specific API, first make sure that your API key is working and returning a response.
You can ask Chatgpt to print checks to show what it is doing and where it is failing.
7. Add Functionality to Existing Code
Prompt:
“Here is my code [code]. Add this function [function]. But don’t change any of my other code. Also, document what you changed and where and give me the full file back.”
Usage:
If you want to add one small piece of code —tell Chatgpt not to change anything with your code.
ChatGPT might remove something important. (if you already have a working version)
8. Code Documentation and Comments
Prompt:
“Can you help me write documentation/comments for this code: [insert code]?”
Usage:
Improve code readability and maintainability by generating clear comments and documentation. This will help you in the future especially if you are sharing with other people.
But if you are getting ChatGPT to write code for you — there is a good chance that you won’t understand everything so is important to do this anyway.
9. Cut and Paste Github Examples
Prompt:
“Here is a code example from Github: [insert code]. I want to make something similar but do [explain difference]”
Usage:
If you can already find something that almost works but you want to change something — it is always much quicker to modify an existing code example than create something entirely new.
10. App Store Checklists
Prompt:
“I’m building a WordPress plugin[insert plugin]. here is a compliance Checklist for WordPress App acceptance — [insert guide]. Can you check my plugin and give a list of exactly what I need to do for any of the steps? Explain in a numbered list. If I don’t need to change anything. Just put that changes aren’t necessary.”
Usage:
If you are building plugins and apps —Cut and paste entire checklists into ChatGPT to help you get accepted into a plugin or app store.
This can save you a ton of time getting your app or plugin approved.
Note:
My brother and I just started a podcast about AI and marketing in the Age of AI and I’ll experiment with adding another AI cohost in the future using this.
You can check out our AI podcast here.
My other Channels:
👉 Sign up to our free 5-Day email course to grow 🚀 and earn💲in the AI age
You can also sign up for my newsletter on how to use AI to earn more money.
Check out our YouTube Channel
Follow us at our website: AI Growth Guys
This article was originally posted on Addison Best Medium.com