🧑🏼💻7 AI CodingTricks Every Programmer Should Know
Hey there, fellow code warriors! 👋
Are you finding yourself in a bit of an AI pickle? You’ve jumped on the AI assistant bandwagon, expecting to code at the speed of light, but instead, you’re stuck in first gear? Don’t worry, you’re not alone! 😉
I’ve heard this tale from my friends-developers: “I started using AI assistants, but I’m just not getting the results I expected, especially at work.” It’s like trying to drive a Ferrari with a learner’s permit — you know there’s potential, but you’re not quite tapping into it. 🏎️
Well, buckle up, because I’m about to share my secret sauce — the tricks that have turned my AI assistants from clumsy sidekicks into coding superheroes 🦸.
These aren’t just for pet projects or “Hello World” programs; these are battle-tested techniques that’ll supercharge your productivity on real-world, complex projects.
So, let’s dive into the 7 AI coding tricks that’ll transform you from an AI novice to a prompting pro! 🚀
1. Precision is Your Best Friend 🎯
Being extremely precise might feel like overkill, but trust me, it’s the secret ingredient to AI magic. The more context your AI assistant has — the better job it can do.
Ideally your prompt should include:
- what is your current target
- where do you start from
- what technologies, libraries, frameworks, patterns are used in the repo
- do you want the solution to be performant? or should it be better maintainable and readable?
- the related code that already exists
- security concerns if any
- any other important details
Why it matters: Spending an extra minute or two crafting a detailed prompt can save you hours of back-and-forth and misunderstandings. It’s like giving your AI assistant a high-resolution map instead of a vague “head north” instruction.
Pro tip: Aim to write a prompt so clear and context-rich that even your non-tech savvy friend could understand what you’re asking for. Your AI assistant will thank you (and so will your future self).
2. Role-Playing: It’s not Just for D&D 🎭
Ever tried asking your AI to put on a different hat? No, I’m not talking about a fancy fedora (although that would be cool). I’m talking about giving your AI assistant a specific role to play.
Here are some examples to get you started:
“You are an expert TypeScript developer with 10 years of experience.”
“Act as a senior software architect specializing in microservices.”
“Imagine you are an award-winning mobile app UI designer.”
Why it matters: By assigning a role, you’re providing a framework for the AI to work within. It’s like giving it a specific lens to view the problem through, often resulting in more tailored and insightful responses.
3. Cut the Fluff: Code Only 📉
In the world of AI prompts, sometimes less really is more. If you’re only after the code, don’t be afraid to be direct about it. End your prompt with “… code only” to get straight to the point and not waste time on reading the greetings and obvious explanations.
Why it matters: This trick saves you time in three ways:
- Faster response generation
- Less scrolling and reading on your part
- Fewer tokens used (hello, rate limit breathing room!)
Remember, you’re not being rude to the AI — you’re being efficient! 😉
4. Share Your Code ⟪⟫
Don’t be shy — let your AI assistant peek at your actual code. It’s not being nosy; it’s being helpful!
- Copy-paste relevant parts of your files
- Use IDE-integrated tools like GitHub Copilot, Cursor, or TabNine. You can read my other article about using Github Copilot @workspace agent to share the context of your repository
- Use context-storing tools that are aware of the main parts of your codebase and keep it up-to-date:
Why it matters: While those YouTube tutorials showing complete apps built in 5 minutes are cool, real-world development is a marathon, not a sprint. By sharing your actual code, you’re giving the AI the context it needs to provide truly relevant and useful assistance.
5. Version Matters: Be Specific 🔢
Ever gotten outdated advice from your AI buddy? Or the API that’s already deprecated? Frustrating, right?
Well, here’s a simple fix:
always specify the versions of tools, frameworks, or languages you’re using.
Why it matters: This simple step can save you from the headache of dealing with deprecated APIs or non-existent configurations. It’s like making sure you and your AI assistant are reading from the same playbook.
6. Embrace the Socratic Method: Let AI ask the questions 🤔
Remember Socrates, the guy who answered questions with more questions? Channel that energy by asking your AI to ask you questions.
Try adding this to your prompts:
“… Please ask me any clarifying questions you need to fulfill this task efficiently.”
Why it matters: Our prompts are never ideal. This approach ensures you’re not missing any crucial details. It’s like having a junior developer on your team who’s not afraid to speak up when they need more info.
7. Break It Down: The Step-by-Step Approach 🪜
Tackling a big task? Don’t try to eat the elephant in one bite. Ask your AI assistant to break it down into manageable steps.
Here’s a prompt I use often:
“Let’s split this task into 5 steps. Give me one step at a time, and I’ll tell you when to proceed to the next one.”
Why it matters: This method keeps things organized, prevents overwhelm, and allows for course correction along the way. It’s like having a GPS that recalculates your route at each turn. Try it yourself and you’ll be surprised how extremely useful it is!
Wrapping Up: Your New AI Superpowers 🦸♂️
There you have it, folks — 7 tricks to level up your AI coding game. Remember, mastering these techniques is like learning to drive that Ferrari. It takes practice, but once you get the hang of it, you’ll be zooming past coding challenges like a pro.
So, go forth and conquer, my fellow developers! Use these tricks, experiment with them, and don’t be afraid to develop your own. The world of AI-assisted coding is still young, and who knows? Maybe you’ll discover the next game-changing trick.
Happy coding, and may your commits be ever in your favor! 🚀💻
P.S. If you found these tips helpful, don’t forget to smash that follow button so you don’t miss out on more AI coding insights.
And hey, drop a comment below with your own AI coding tricks — let’s learn from each other!