← back to knowledge-hub

Prompt Engineering: Get Better Results from AI

I’ve been using AI tools daily — ChatGPT for writing, GitHub Copilot for code, Midjourney for visuals — and I noticed something early on: the same tool gives wildly different results depending on how you talk to it. Two developers can use the exact same model and get outputs that are miles apart. The difference isn’t the tool. It’s the prompt.

That realization pushed me down the rabbit hole of prompt engineering — the practice of crafting inputs that consistently pull better outputs from AI systems.

Why Prompts Matter More Than You Think

AI follows a simple principle: garbage in, garbage out. A vague request gets a vague response. But here’s what’s less obvious — even a slightly more specific prompt can dramatically improve the output quality.

Think of it like a Google search. Typing “donut” gives you recipes, images, shops, calories — everything and nothing. Typing “Blender3D donut modeling tutorial beginner” gives you exactly what you need. AI works the same way, except you can push it further with context, constraints, and persona.

Prompt Engineering for Chat (ChatGPT, Claude, etc.)

The biggest mistake I see people make with chat AI is treating it like a search engine — one question, one answer, done. The real power comes from conversation.

Here’s what I mean. If I need a paragraph about NDC Conferences for a trip report, I don’t just ask “write about NDC.” Instead, I build context first:

“I attended NDC Oslo — it’s a major software development conference in Norway. The sessions I found most valuable were on AI integration and cloud architecture. Write a short paragraph for my trip report highlighting these themes.”

That extra context transforms the output from generic fluff into something I can actually use.

The Specificity Principle

Compare these two prompts:

Weak: “Give me tips for a job interview.”

Strong: “I’m interviewing for a senior .NET developer role at an AI startup next week. Give me preparation tips covering technical questions they might ask about microservices and cloud architecture, plus how to research a small company effectively.”

The second prompt works because it tells the AI who you are, what you need, and what context matters. You’re essentially giving it the same information you’d give a mentor if you were asking for personalized advice.

Prompt Engineering for Image Generation

Art generators like Midjourney and DALL-E are even more sensitive to prompt quality. I learned this the hard way — typing “dog” into Night Café gave me something that looked like a fever dream painted by an enthusiastic toddler.

What works: describe the scene like you’re briefing a photographer.

Weak: “dog in park”

Strong: “Photorealistic image of an adult German Shepherd sitting in a green park on a sunny day, shallow depth of field, natural lighting, high resolution”

The key elements are: subject, setting, style, lighting, and quality modifiers. Most art tools have character limits, so every word needs to earn its place. Expect to iterate — I typically go through 3-5 rounds of refinement before I get something I’m happy with.

Prompt Engineering for Code (GitHub Copilot)

Code assistants like GitHub Copilot work differently from chat tools. They read your entire file context — the file extension, imports, existing functions, and comments — to predict what you need next.

The trick is to write comments that describe intent and approach, not just the goal:

1
2
3
4
5
# Function to reverse a sentence: split into words, reverse the list, join back
def reverse_sentence(sentence):
    words = sentence.split()
    reversed_words = words[::-1]
    return ' '.join(reversed_words)
1
2
3
4
5
6
// Method to reverse a sentence: split by space, reverse array, join with space
public string ReverseSentence(string sentence) {
    string[] words = sentence.Split(' ');
    Array.Reverse(words);
    return string.Join(" ", words);
}

Breaking complex tasks into smaller, well-commented steps gives Copilot the context it needs to generate accurate suggestions. Unlike chat tools where recent messages dominate, Copilot weighs the entire file equally — so your function names, variable names, and code structure all act as implicit prompts.

My Prompt Engineering Checklist

After months of daily use, these are the principles that consistently work for me:

  • Lead with context — tell the AI who you are, what you’re working on, and what the output should look like
  • Be specific about constraints — audience, length, format, tone
  • Break complex requests into steps — don’t ask for everything at once
  • Iterate conversationally — refine rather than restart
  • Verify everything — especially code and factual claims

The Takeaway

Prompt engineering isn’t magic, and it’s not a separate skill from your domain expertise — it’s the bridge between what you know and what AI can do for you. The better you understand your problem, the better you can communicate it to an AI system.

I’m still refining my approach with every new model release. The landscape moves fast, but the fundamentals stay the same: clarity, context, and specificity always win.