AI Coding for Beginners
To code with AI as a beginner, pick a small project, describe it in a short written plan, and let an AI assistant write the first version one feature at a time. Your job is to run the code, review what changed, test it against your plan and ask the AI to explain anything you don’t understand. In this tutorial you’ll build a one-page habit tracker that runs in any browser, then try the same workflow in Cursor and GitHub Copilot.
On this page
Course overview
- One finished project: a habit tracker in a single HTML file
- No installs needed for the main project; a free code editor is optional
- Mini-lessons for Cursor and GitHub Copilot
- The core skill: accepting code is not the same as checking it
What AI Coding and Vibe Coding Mean
AI coding means using an AI assistant to write, explain, fix or review code. It ranges from autocomplete suggestions while you type to agents that edit many files and run commands.
Vibe coding is a term popularized by AI researcher Andrej Karpathy in early 2025 for building software by describing what you want and accepting the AI’s code without reading it closely. It’s fun for quick experiments and throwaway prototypes. It’s risky for anything that handles real users, money or personal data, because problems you never looked at end up in the product.
| Vibe coding | Reviewed AI coding | |
|---|---|---|
| Goal | See something work fast | Build something you can trust and maintain |
| You read the code? | Rarely | Yes, at least the parts that changed |
| Testing | “It seems to work” | Checks against a written plan, plus automated tests where possible |
| Good for | Personal toys, demos | Work projects, anything shared with others |
This tutorial teaches reviewed AI coding. You’ll move fast, but you’ll always know what changed and why.
Which tool to use
- A chat assistant (ChatGPT, Claude, Gemini): paste code in and out. Easiest start, used in the main project below.
- An AI code editor such as Cursor or VS Code with GitHub Copilot: the AI sees your files and suggests edits in place.
- A coding agent such as Claude Code: works across a whole project, runs tests and uses Git with your approval.
Plan a Small Project and Set Up a Workspace
Small, specific projects succeed. “Build me an app” fails. Write a one-paragraph plan with a short list of features and how you’ll know each one works.
Project: a habit tracker in ONE HTML file (HTML, CSS and JavaScript together), no frameworks, no server. Features: 1. Add a habit by typing a name and pressing Enter or an Add button 2. Show the last 7 days as checkboxes for each habit 3. Clicking a checkbox marks that day done; it stays after reloading the page (use localStorage) 4. Delete a habit with a confirmation Acceptance tests: - Adding an empty name does nothing - After reload, habits and checkmarks are still there - Works on a phone-sized screen
Set up your workspace
- Create a folder called
habit-trackeron your computer. - Install a free code editor such as Visual Studio Code (optional but recommended), or use any plain text editor.
- Create an empty file named
index.htmlin the folder. - Optional: if you know Git, run
git initin the folder so you can track every change.
Build and Review a First Version
Step 1: Build feature by feature
Here is my project plan: [paste the plan] Build only features 1 and 2 for now, in a single index.html file. Keep the code simple and add short comments explaining each part. After the code, list what I should test manually.
Copy the code into index.html, save, and double-click the file to open it in your browser.
Step 2: Review before adding more
Before you ask for features 3 and 4, make sure you understand version one:
- Run every manual test the AI listed; note anything that fails
- Ask: “Explain how the 7-day checkboxes are generated, step by step”
- Ask: “What happens if two habits have the same name?” Edge cases like this reveal hidden bugs
- Skim the code for anything that loads files from the internet you didn’t ask for
Step 3: Add the next feature
Version 1 works. Now add feature 3 (save to localStorage so data survives reloads) and feature 4 (delete with confirmation). Show me only the parts of the file that change, and explain each change in one sentence.
Why “show only what changes”
Smaller changes are easier to review. If the AI rewrites the whole file every time, it can silently drop or alter code that already worked.
Try Cursor and GitHub Copilot
Once you’re comfortable with the chat workflow, an AI-enabled editor saves copying and pasting. Both tools below have free tiers with usage limits; check their official pricing pages for current details.
Cursor tutorial: edit your project with an AI editor
Cursor is a code editor built around AI. It looks and works much like VS Code and can import your VS Code settings.
- Download Cursor from its official website (cursor.com) and create an account. A free tier is available with limited AI usage.
- Choose File → Open Folder and select your
habit-trackerfolder. - Open the AI chat or agent panel and ask: “Read index.html and summarize how data is stored.” Cursor uses your open files as context.
- Ask for a small change: “Add a counter showing how many days in the last 7 each habit was completed.”
- Cursor shows the proposed edits as a diff in the file. Review each change and accept or reject it.
- Reload the page in your browser and test the feature.
Tip: as you type code, Cursor suggests completions. Press Tab to accept, or keep typing to ignore.
GitHub Copilot tutorial: AI suggestions in VS Code
GitHub Copilot is an AI coding assistant from GitHub. The free plan (checked November 18, 2026) includes up to 2,000 code completions per month plus Copilot Chat; Copilot Pro is listed at $10 per month.
- Create a free GitHub account if you don’t have one.
- In Visual Studio Code, open the Extensions view, install GitHub Copilot, and sign in with GitHub when prompted.
- Open your
habit-trackerfolder. Inindex.html, type a comment such as// function that returns the last 7 dates as YYYY-MM-DDand press Enter. Copilot shows a gray suggestion; press Tab to accept. - Open Copilot Chat and ask: “Explain this function and write two test cases for it.”
- Read the suggestion before accepting, just as you would review a coworker’s code.
How they compare for beginners
| Chat assistant | Cursor | GitHub Copilot (VS Code) | |
|---|---|---|---|
| Setup | None | Install a new editor | Extension in VS Code |
| Sees your files | Only what you paste | Yes | Yes |
| Best for | Learning and small scripts | Multi-file edits with diffs | Inline suggestions and chat in a familiar editor |
Test Debug and Improve the Project
Test against your plan
Go through every acceptance test from your plan. Then test in a phone-sized window: in Chrome or Edge, open Developer Tools and switch on the device toolbar.
Debug with the AI, not around it
When I reload the page, the checkmarks for today disappear but older days stay. Here is the relevant code: [paste the function that saves and loads data] Explain the most likely cause before writing a fix. Then give the smallest change that fixes it.
Asking for the cause first stops the AI from piling on random changes. Bugs with dates and time zones are common in this kind of project.
Improve it
- Ask for an accessibility review: “Check labels, keyboard use and color contrast.”
- Ask for a simple automated test of the date function, and run it.
- Ask: “What would break if 50 habits were added?” and decide if it matters.
Next step: try a coding agent that works across a real project with Git and tests in our Claude Code tutorial for beginners. For structured courses on building with AI, see AI courses.
Sources
Plans and features checked November 18, 2026.