Coding Prompts
Welcome to the episode. Today we’re talking about coding prompts: the instructions we give an AI assistant when we want help writing, understanding, or improving software. A good prompt won’t replace your judgment or testing, but it can make the difference between a vague suggestion and a useful first draft. Whether you’re new to programming or already working on a project, a few simple habits can help you get better results.
First, give the assistant a clear goal and some context. “Write a function” leaves a lot unanswered. What should the function do? What language and framework are you using? Where will the code fit into your project? A more useful request might say, “In Python, write a function that takes a list of prices and returns the total after applying a 10 percent discount.” If there are constraints—such as a required input format or a library you can’t use—include those, too. Specific coding prompts help reduce guesswork.
Second, describe the expected behavior, not just the implementation. You may have an idea about how to solve a problem, but explaining what should happen is often more helpful. Include examples of inputs and outputs, and mention edge cases. For instance, should the function handle an empty list? What should happen if an input is missing or invalid? These details give the assistant a clearer target, and they give you something concrete to check when you review the answer.
Third, ask for an explanation at the level you need. If you’re learning, ask the assistant to walk through the code step by step and explain unfamiliar concepts. If you’re experienced and want a quick review, request a concise summary of the approach, trade-offs, and any assumptions. You can also ask for tests alongside the code. Tests make expected behavior visible and can reveal problems that a polished-looking answer might otherwise hide.
Fourth, treat the conversation as an iterative process. The first response is a starting point, not a final verdict. Run the code, inspect the result, and share specific errors or unexpected behavior in a follow-up prompt. Instead of saying, “It doesn’t work,” explain what you tried, what you expected, and what happened. If the solution is too complicated, ask for a simpler version; if it misses a requirement, restate that requirement clearly. Small, focused revisions are often easier to evaluate than asking for everything again from scratch.
And remember to review what you receive. AI-generated code can contain bugs, make assumptions about your environment, or use patterns that don’t suit your project. Check it against your requirements, run the tests, and be especially careful with security-sensitive code and private data. A confident explanation isn’t proof that the code is correct.
The best coding prompts are clear, contextual, and testable—and the best results come when you stay involved. Think of an AI assistant as a collaborator that can help you explore options, draft code, and understand unfamiliar ideas, while you remain responsible for deciding whether the solution is right. Start with the goal, add useful details, and refine from there. That’s a practical way to turn coding prompts into better conversations—and better code.