A helper that can be wrong
Imagine a helper who writes code very fast. They never get tired. But sometimes they sound sure and they are wrong.
That is generative AI. It can write a short piece of code for you. You must still check it. You are the developer. The helper is only a tool.
Key words
| Word | What it means | Example |
|---|---|---|
| Generative AI | A tool that writes text or code when you give it a prompt. | a chat assistant |
| Prompt | The words you give the AI to say what you want. | Write a Python function that ... |
| Snippet | A short piece of code for one job. | one function |
| Review | Checking something carefully and deciding if it is good. | run it and read it |
| Design | A plan of how the solution will work, made before building. | screens and steps |
| Algorithm | A list of steps that solves a problem. | steps to join a waiting list |
| Flowchart | A diagram of steps with arrows. | start, check, book |
| Library | Extra code that other people wrote, which you can use. | pandas |
| Function | A named piece of code that does one job. | next_in_line() |
| Interface | What the user sees and uses. | a form |
The cells students fill in are left blank in this preview.
What a design pack holds
| Part | What it shows | Hillside example |
|---|---|---|
| Interface design | The screens the user will see | A "Join the waiting list" button and a list |
| Algorithm design | The steps for the key problems | A flowchart for moving the first person up when a booking is cancelled |
| Data design | What is stored, and in what form | A waiting list file with member, court, hour |
The cells students fill in are left blank in this preview.
Which part of the design does the job?
Have a go
Which part of the design does the job?
6 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
A good prompt is a clear brief
A weak prompt gets a weak answer. Say clearly what you want:
- The language and version.
- The job of one function.
- What goes in and what comes out.
- An example.
- Limits, such as "use no libraries".
Ask for one small function. Do not ask the AI to build the whole tool.
A weak prompt and a strong prompt
| Weak | Strong |
|---|---|
| Make a waiting list | Write a Python 3.10 function join_waiting_list(waiting, member, court, hour). waiting is a list of dictionaries. Add the member and return their place for that court and hour. Return 0 if they are already waiting. Use no libraries. |
| Fix my code | This function should return 0 for a repeat member. It returns 2. Here is the code and the test. What is wrong? |
The cells students fill in are left blank in this preview.
Quick check: prompts and checks
Have a go
Quick check: prompts and checks
5 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.