The Lab

AI for Coding

Build software with AI as a pair, without losing the plot.

Lessons

  1. Say exactly what you want

    AI writes better code when you describe the goal, the tools and an example. "Make a p5.js sketch where a ball bounces off the edges and changes colour when it hits one" works far better than "make a game".

  2. Read every line

    Code you don't understand is code you can't fix. Ask the AI to explain anything unclear, line by line. If something still doesn't make sense, ask for a simpler version.

  3. Small steps, run it often

    Ask for one small change at a time, run it, and check it does what you expected before asking for the next. When something breaks, give the AI the exact error message and what you were trying to do.

  4. Keep secrets out

    Never paste passwords, API keys or other people's private data into an AI chat. AI can also suggest code that is out of date or unsafe, so treat it like a helpful classmate whose work you always check.

Try it

Your project

Ask an AI to help you build a small p5.js sketch, a game or animation of your own idea. Paste it into the sandbox above and get it running. Then change three things yourself, without AI, and explain to someone what each part of the code does.