41039 · Programming 1
Week 1 · 41039 Programming 1

Introduction — Your First Program

Today assumes you have never programmed before. You will see more things than we can fully explain, and that is on purpose — Week 1 is about recognising the shape of a program, not mastering it.

No lab this week 7 Ed lessons · ~2 hours Lecture slides (PDF) Java Python
Week 1 · Interactive

The lecture, then the practice

Choose a section from the list to open it — or use the arrow keys once the list has focus. Code blocks are live: edit them, run them, and break them on purpose.

01What programming is

1.1Telling a computer what to do

Once that meant writing the right sequence of zeroes and ones into memory. In 1954 John Backus developed FORTRAN, and the programmer could start caring about what to do rather than exactly how.

Two programmers operating the ENIAC computer in 1946
ENIAC, 1946 — Betty Snyder and Glen Beck. The first programmers were overwhelmingly women.US Army photo, public domain
A FORTRAN punched card
One FORTRAN statement, on one punched card. Drop the box, lose the program.Photo: Arnold Reinhold, CC BY-SA 2.5

The history of programming is the history of raising the level of abstraction. Every convenience you are about to complain about was once a luxury.

1.2“Can’t AI just do all this now?”

A randomised controlled trial by METR (July 2025) gave experienced developers AI tools on their own projects. They predicted they would be 24% faster. They were 19% slower — and afterwards still believed they had been 20% faster.

xkcd comic about machine learning
xkcd 1838, Machine Learning — Randall Munroe, CC BY-NC 2.5
The point

They could not tell. The tool is not the problem — the inability to evaluate its output is, and that is a reading skill. It is what this subject builds.

1.3The hard part is knowing what is hard

xkcd comic: Tasks
xkcd 1425, Tasks — Randall Munroe, CC BY-NC 2.5

Two requests that sound equally reasonable to someone who has never programmed. One is an afternoon’s work; the other was an open research problem for decades. Building the instinct for which is which takes the whole session — you will start the first time an “easy” exercise takes two hours.

1.4The three basic tools

  • State — managing what situation the program is in
  • Branching — choosing which code runs, based on the state
  • Repetition — repeating code, controlled by some parameter

Add input and output and that is everything needed for a general-purpose language. This is SLO1.

ConceptWeekTopic
StateWeek 2Data types and variables
BranchingWeek 3Decisions and branching program flow
RepetitionWeek 5Loops and iterative program flow

Everything from Week 6 — classes, methods, lists, files, inheritance — adds no fourth idea. It is about organising these three as programs grow.

03 · This week

What to actually do

On Ed, work through all seven Week 1 lessons, top to bottom:

  1. Everything you need to know about Ed — turn on Line Numbers
  2. Everything you need to know about labs
  3. An important warning — please read this one properly
  4. The Basics of Programming
  5. Introduction to Java
  6. Introduction to Python
  7. Debugging Programs — don't skip it; your first lab throws errors at you
Run the code in the readings

Change things. Break things on purpose and read what the error says. Refreshing the page restores the original — you cannot damage anything.

Key facts

Nothing needs installing — Ed gives you Java and Python in the browser. No lab in Week 1; labs start Week 2. Assessed lab exercises are due 11:55pm the Monday of the following week, with unlimited attempts — but you must pass all test cases in an exercise to get its marks.

Next week: variables, types, and talking to the user.

Sources

Everything cited on this page

Every claim above links to where it came from. Checking a source yourself is a better habit than trusting any lecture slide, including ours.

Articles and reports

Comics

All by Randall Munroe, xkcd.com, used under CC BY-NC 2.5: 303, 353, 627, 979, 1425, 1513, 1739, 1838.

Photographs

All photographs via Wikimedia Commons.