We use cookies to run the site, and (only with your permission) to understand usage with analytics.Read our Privacy Policy.

Analytics is off until you accept.
Tutorials

Teaching Programming to First-Years? Here's a 6-Week Plan

SANJAY7 minutes
Teaching Programming to First-Years? Here's a 6-Week Plan

Teaching programming to first-year students works best when the first six weeks follow a simple rhythm. Every student writes and runs code in the first lab, builds one small, complete program each week, and gets feedback before the next lab. Concepts arrive one at a time, and reading code gets as much attention as writing it.

Below is a week-by-week plan you can adapt for a C or Python course, along with how to run each lab and keep feedback going for a large batch.

Why do the first six weeks matter so much?

First-year batches are mixed. Some students took computer science in Classes 11 and 12, and others have never written a line of code. The early weeks are when the second group decides whether programming is "for them".

Three things usually go wrong early on: the first lab is lost to setup, the first assignment is too big, and feedback arrives too late to help. This plan is built to avoid all three.

What does a 6-week plan for teaching programming look like?

WeekConceptWhat students buildWhat you check
1Input, output, variablesA program that reads two numbers and prints their sum and averageIt runs and reads input correctly
2Decisions (if/else)An electricity bill calculator with slab ratesEvery slab boundary
3LoopsMultiplication tables and simple number patternsLoop limits and off-by-one errors
4FunctionsThe week 2 bill program, rewritten with functionsSame output, cleaner structure
5Arrays or listsA class marks report: average, highest score, number who passedOne student, equal marks, nobody passing
6Mini projectA canteen billing programA working program and a short viva

Week 1: Get every student running code in the first lab

The goal for the first lab is simple: every student runs a program they wrote. Don't spend it installing compilers on 60 lab machines or on students' own laptops. Use an environment that opens in a browser, so setup doesn't eat the class.

Start with a print statement, then input, then a small calculation. Before students run anything, ask them to change one line and predict the output. That habit of predicting first will pay off for the rest of the course.

Week 2: Decisions, using a problem they already know

Every student has seen an electricity bill. Give them a slab structure, such as one rate for the first 100 units and a higher rate after that, and ask them to calculate the bill.

The boundaries teach testing without a lecture on testing. What happens at exactly 100 units? At 0? Let students find the bugs themselves before you point them out.

Week 3: Loops, traced by hand first

Before students run a loop, have them fill in a trace table on paper: the value of the loop variable and the output at each step. Off-by-one errors show up on paper long before they become confusing bugs on screen.

Number patterns and multiplication tables work well here. They're visual, and a mistake is obvious the moment the output appears.

Week 4: Functions, by improving old code

Don't introduce functions with a new problem. Take the week 2 bill program and split it into three parts: read the units, calculate the bill, print the bill. The output stays the same, but the structure gets better.

Students see why functions exist, because they're fixing their own code instead of learning syntax in the abstract.

Week 5: Arrays with real class data

Give students a list of marks for a class of 60. They calculate the average, find the highest score and count how many scored 40 or above.

This is the week to bring in edge cases. What if there's only one student? What if everyone scored the same? What if nobody passed? These become the hidden test cases you check.

Week 6: A mini project and a five-minute viva

Combine everything in one small project, such as a canteen billing program with a menu, quantities and a discount rule. Then hold a short viva: ask each student to explain one function and make one small change live.

The viva is familiar from practical exams, and it's the quickest way to see who understands their own code.

How should each lab session run?

A steady rhythm helps beginners more than variety does. Try this for a two-hour lab:

  1. A 10-minute live demo. Code in front of the class, including the mistakes. Students learn a lot from watching you read an error message.
  2. Predict, run, change. Students predict what a short program prints, run it, then change it to do something new.
  3. Pairs first, then alone. The first exercise is done in pairs, and the main exercise individually.
  4. An exit task. One small exercise submitted before they leave, so you know where everyone stands.

How do you give feedback to 180 students every week?

Feedback that arrives after the next lab barely helps. To keep it fast with large batches:

What about AI tools in a first-year programming class?

Set the rule by task, not with a blanket ban. In the first four weeks, ask students to write the core logic themselves and use AI only to explain an error message they don't understand. Later, AI can help them compare two ways of solving a problem.

Whatever the rule, ask students to explain the code they submit. Our guide on how programming assignments can evolve for AI-assisted learning goes further.

Which mistakes should you avoid when teaching programming to beginners?

For the confidence side of this, read how coding classes can help beginners build confidence.

Where does Lab.Computer fit?

Lab.Computer's online coding labs run in the browser with nothing to install. Every student gets the same environment for each assignment, launched within seconds whether you teach 30 students or 3,000, in 40+ languages including Python, Java and C++. The AI Assignment Generator drafts each week's exercise with public and hidden test cases, and AI Evaluation runs those tests and drafts feedback for you to review, edit or override. The instructor dashboard shows assignment completion and performance, so you can see who is falling behind before the mid-semester exam.

Quick takeaways

Planning next semester's first-year lab? Book a demo and we'll set up week one with you.

Frequently asked questions

Which language is best for teaching programming to beginners, C or Python?

Both work. Python lets beginners see results sooner with less syntax, while C shows how memory and types work and is still the first language in many university syllabi. Use the one your syllabus requires, and keep the first weeks focused on problem-solving rather than syntax.

How do I teach programming to students with no coding background?

Start with small programs they can run in the first lab, use problems from daily life, ask them to predict output before running code, and give feedback every week. Pairing them with classmates who have some background helps in the first few exercises.

How long does it take beginners to write their own programs?

With practice every week, beginners can usually write small programs that use input, decisions and loops within the first month. Functions and arrays take longer and need more practice.

How do I manage a large programming lab with 60 or more students?

Remove setup from the lab, run automated tests on every submission so students get results straight away, start each lab with the most common mistakes from the last one, and spend your own time on students who are stuck.

Should first-year students use AI to learn programming?

For the first few weeks, ask them to write the core logic themselves and use AI only to explain error messages. Later, AI can help them compare approaches. Either way, ask them to explain the code they submit.

Teaching ProgrammingFirst-Year StudentsProgramming LabsCoding EducationCS Education