A student's guide to AI pair programming (note: this is adapted from various online sources and edited using AI tools)

1. Why good prompts matter

Working with an AI pair programmer is like having a conversation. The quality of its answers depends heavily on the quality of your questions. A well-written prompt will get you useful, relevant code and explanations. A vague or confusing prompt will lead to generic, unhelpful, or incorrect responses.

This guide will teach you how to "engineer" your prompts to get the best possible results from your AI partner. Learning this skill is a key objective of this assignment.

2. The four C's of effective prompting

A good prompt gives the AI the information it needs to be a helpful partner. A simple way to remember this is with the "Four C's": Context, Clarity, Conciseness, and Constraints.


3. Example scenarios

Here is how you can apply the Four C's in different situations during your project.

Scenario 1: Starting the project

Your first prompt is crucial for setting the Context.

Scenario 2: Asking for a specific function

When you need a new feature, be Clear and Concise.

Scenario 3: Debugging an error

When you have a bug, give the AI all the information. The error message itself is critical Context.

4. What to do when the AI is wrong

AI models are not perfect. They will sometimes:
- Make up facts or library names ("hallucinate").
- Give you code that doesn't run.
- Give you code that is inefficient or overly complex.


It is your job to be the human in the loop!
- Always test the code. Never assume the AI's output is correct.
- Think critically. Does the explanation make sense? Is there a simpler way to do this?
- Re-prompt if needed. If you don't get a good answer, try rephrasing your question. Add more context or be more specific. Tell the AI what was wrong with its last response.


Good luck!