- Microsoft battles more bugs in Windows 11 24H2 with new round of patches
- OnePlus Watch 3 vs. Google Pixel Watch 3: I tested both Android wearables, and it's a close one
- Overcoming data compliance and security challenges in the age of AI
- How Cisco’s Employees Work Together to Give Back
- Beware of Fake Cybersecurity Audits: Cybercriminals Use Scams to Breach Corporate Systems
25 AI tips to boost your programming productivity with ChatGPT

I’ve been experimenting with using ChatGPT to help turbocharge my programming output for over two years. When ChatGPT helped me find a troubling bug, I realized there was something worthwhile in artificial intelligence (AI).
Many people I talk to think that AI is a magic genie that can manifest an entire program or app out of a single, barely-formed wish. Here’s a much better analogy: AI is a power tool.
Also: The best AI for coding in 2025 (and what not to use – including DeepSeek R1)
Sure, you can use an old-fashioned saw to cut wood, but a table saw goes much faster. Neither tool makes furniture. They simply help you make furniture. Keep in mind that the AI isn’t going to write your code for you. It’s going to help you write your code.
Although there’s no objective way for me to tell you exactly how much ChatGPT has helped me, I am fairly convinced it has doubled my programming output. In other words, I’ve gotten twice as much done by using ChatGPT as part of my toolkit.
Also: How I test an AI chatbot’s coding ability – and you can, too
I’ve mostly been using ChatGPT Plus rather than the free version of ChatGPT. Initially, it was because the GPT-4 model in Plus was better at coding than the GPT-3.5 model in the free version. However, now that both versions support some variant of the GPT-4o model, their coding capabilities are identical. Remember that you only get so many queries with the free version before you’re asked to wait a while, and I find that interrupts my programming flow. So, I use the $20/month Plus version.
I should note that I’ve tested many large language models (LLMs) against my real-world coding and found that only a few (and all based on ChatGPT’s LLMs) could handle everything I’ve thrown at it. So although there are a lot of cool AI tools for programmers being made available (some even for free), they’re not going to be all that helpful unless the code the AI produces actually works. The good news is that AIs will inevitably get better at coding over time, so this should cease to be much of an issue.
Also: The five biggest mistakes people make when prompting an AI
Thinking back on all my projects, I realized there are some tangible tips I can share about how to get the most out of an AI programming partner. Let’s dig in.
1. Give the AI lots of small jobs
The AI doesn’t handle complex sets of instructions well, especially if you expect it to do product design. However, the AI is extremely good at parsing and processing small, well-defined instructions.
2. Think of the bot as someone at the end of a Slack conversation
Rather than the pacing that might come from an email back-and-forth with a colleague, which might have each interaction separated by hours, imagine you’re in a Slack chat where each interaction is much smaller, but separated by seconds.
3. For more complex routines, prompt iteratively
Start with a simple assignment and, when that’s been properly written, add more to it, element by element. I cut and paste the previous prompt, adding and removing bits of the prompt, as I get chunks of code that work for what I’m looking for.
4. Test every little chunk of code the AI returns
Don’t ever assume the code will work. Patch the code into your project and see how it performs.
5. Use the debugger
For a more in-depth test, don’t hesitate to drop into the debugger and walk through the code generated by the AI step-by-step. Watch the variables and exactly what the AI does. Remember, it’s OK to let it write code snippets for you as long as you check every statement and line for proper functioning.
6. You don’t need Al coding assistance built right into your IDE
Many coding tool vendors are pitching the idea of integrated AIs in their tools. Among other things, this approach enables them to upsell you the AI features. However, I prefer using ChatGPT for coding as a separate tool from my development environment. I don’t want an AI to be able to reach into my primary coding environment and change what’s there.
7. Feel free to cannibalize lines of code from generated routines
You don’t always have to use everything the AI produces for you. In the same way that you might go to Stack Overflow to look for code samples, and then pick and choose the lines you want to copy, you can do the same with AI-generated code.
8. Avoid asking the AI to do proprietary coding or use institutional knowledge it doesn’t have
AI LLMs run on training data or what they can find on the web. That means they generally know nothing about your unique application or business logic. So, avoid trying to get the AI to write anything that requires this level of knowledge. That’s your job.
9. Give the AI examples to work on so it understands the context of your code
I gave ChatGPT a snippet of an HTML page and asked it to add a feature to expand a block of text. The AI gave me back HTML, JS, and CSS. I later asked it for an additional CSS selector and then asked it to justify its work, whereupon it explained to me why it did what it did. All of that process worked because the examples I gave the AI helped it understand the context.
10. Use the AI for common knowledge coding
The biggest benefit of AI is writing blocks of code that use common knowledge, popular libraries, and regular practices. The AI won’t be able to write your unique business logic. But if you ask the AI to write code for capabilities from libraries and APIs, it will save you lots of time.
11. Feel free to ask for one- or two-line snippets
Even if you need something that might only generate a line or two of a response, use the AI as you would use any research tool if it can save you time.
12. Tell the AI when the code it wrote doesn’t work
I find AI often spits out incomplete or non-functional code. Tell it what isn’t working, and perhaps suggest to clarify. Then ask the AI to write something new. It usually does and the revised code is sometimes better than the original.
13. Use one Al to check the work of another Al
It’s interesting to see how two language models interpret the same code. As we’ve seen, not all language models work all that well, but their results can be instructive. You can even have one ChatGPT session check the results from another ChatGPT session.
14. Use the AI to write CSS selectors
CSS selectors are the expressions coders use to define an element on a web page for styling or other actions. They get complex and arcane quickly. I often copy a block of HTML and ask for a selector for a given piece of that HTML. This approach can save a lot of time. However, remember you’ll usually have to iterate, telling the AI that the first few selectors don’t work until it generates one that does.
15. Use the AI to write regular expressions for you
Regular expressions are symbolic math sequences most often used for parsing text. I dislike writing them almost as much as I dislike writing CSS selectors. The AI is great at writing regular expressions, although you’ll need to test them.
16. Use the AI to test regular expressions
I use the app Patterns to test generated regular expressions on my Mac Studio. But AI can help as well. I often feed a separate instance of the AI a regular expression generated by ChatGPT. Then I ask that separate instance, “What does this do?” If I get back a description in line with what I wanted the function to do, I feel more confident the AI did what I wanted.
17. Let the AI do complex loop math
As with CSS selectors and regular expressions, complex loop math can be tedious and error-prone. This is an ideal application for an AI. When specifying your prompt, don’t tell the AI what’s in the loop. Let it write the appropriate loop wrapper elements, then write the business logic after that process works.
18. Use ‘What is wrong with this code?’ as a prompt
I will often feed blocks of code, especially regular expressions generated by the AI, to the AI. It can be very instructive to see what the AI thinks is wrong with the code, often highlighting error conditions the code doesn’t test. Then, of course, ask the AI to regenerate the code fixing the errors it found.
19. Use ‘What does this do?’ as a prompt
Likewise, I like to feed blocks of code to the AI and ask it, “What does this do?” It’s often instructive, even for my own code. But the biggest benefit comes when working on code written by someone else. Feeding a function or a block to the AI can save time in reverse engineering the original code.
20. Know when to give up on the AI
Sometimes, the AI can’t do the job. I’ve found that if you try to have the AI rewrite its code more than two or three times, you’re past the point of no return. If you want AI-generated code, start with a brand-new, reworded prompt and see what you get from there. And sometimes, you’ll have to go on your own.
21. Be specific in your function and variable naming
The AI picks up intent from variable and function names and writes better code. For example, specifying a variable name as $order_date helps tell the AI that you’re dealing with an order and a date value. It’s a lot better than something like $od. Even better, code generated from well-named variable names is also often more readable, because the AI knows to use more descriptive names for the other variables it creates.
22. Read the pre- and post-code notes
The AI usually generates notes about each prompt before and after the code it writes. There can be gems in there that can help you understand what the AI did or how it approached the problem. Sometimes, the AI will also point you to other libraries or functions that could be useful.
23. It’s OK to go back and ask for more help on a code snippet
Grab the various pieces of code from your project to illustrate what you need, tell ChatGPT to read them, and then ask what you want. I needed to build an exclusion for input fields in an expanded area and asked the AI. Less than a minute later, I had code that would have taken me between 10 minutes and an hour to write myself.
24. Use the Al to help you rewrite obsolete code blocks
I had a PHP module written in an older version of PHP that used a language feature that’s now deprecated. To update the code, I pasted the deprecated code segment into ChatGPT and asked it to tell me how to rewrite it to be compatible with most current PHP release. It did, and it worked.
25. Use AI to help you write for less familiar languages
I’m very comfortable picking up new programming languages, but I’ve found that AI can be helpful if I need to code in a language I’m not an expert in. I ask the AI how to write what I want and specify the language. Let’s say I want to know how to do a case statement in Python and I’ve been doing them forever in PHP. Just ask, “Compare writing a case statement in PHP and Python”, or “How to concatenate a string in Python vs PHP”. You’ll get a great comparison and the process makes writing unfamiliar code much easier.
Also: I was an AI skeptic until these 5 tools changed my mind
Here’s a bonus tip. Check with your company about the legal issues of code generated. If you’re unsure where to start, read my article on AI and code ownership. If you use the tips I shared with you, you’ll never be using AI to write unique business logic or the core of what makes your code unique. As such, you’ll likely be able to retain the copyright of that code, which should make up the key element of your unique value.
I write code for internal use by a company or open-source code, so I’m not concerned with ownership issues for AI-generated snippets.
Have you used an AI to help write code? Do you have any tips to add to my list above? Let us know in the comments below.
You can follow my day-to-day project updates on social media. Be sure to subscribe to my weekly update newsletter, and follow me on Twitter/X at @DavidGewirtz, on Facebook at Facebook.com/DavidGewirtz, on Instagram at Instagram.com/DavidGewirtz, and on YouTube at YouTube.com/DavidGewirtzTV.