Skip to Computer Science content

Plain CS learning guide

Independent Learners

Create a manageable route through computer science without collecting disconnected tutorials. Work toward a project, practise regularly and use evidence to decide what to learn next.

Follow the lessons here in order if you are new to programming. Each example can be traced on paper; the small Python snippets are optional to run. Keep one project notebook and return to an earlier lesson whenever the checkpoint is unclear.

Check your starting point

Suitable for beginners and returning learners. Choose a goal, check your current skills and set a study rhythm you can maintain.

Your goal: Complete a small documented project and explain the computing ideas behind it without relying on a tutorial.

A question to begin with

What should a program that adds a list of numbers do when the list is empty? How would you show that your answer is deliberate rather than an accident?

Compare your reasoning

Choose and document a rule: for an ordinary sum, return zero. Trace the initial state and add an empty-list test. The important habit is connecting a requirement, implementation and test.

Your learning path

Use these four stages to organise your work. The lessons, exercises and project below give you material to practise directly on this page.

Pick a practical outcome such as a text tool, simple game or data organiser.

Try it: Describe the smallest useful version. Try a short programming exercise and list the concepts you cannot yet explain.

Checkpoint: Your plan has one concrete outcome and a realistic next study session.

Learn how data, programs, devices and networks fit together. Work through exercises rather than only watching or reading.

Try it: Use the on-page computing and programming lessons and keep a notebook of explanations in your own words.

Checkpoint: Explain a new concept with an example you did not copy from the lesson.

Use one language long enough to learn functions, collections, errors and testing.

Try it: Build small solutions with lists and maps. Revisit a previous solution after learning about operation costs.

Checkpoint: Solve a comparable problem from a blank file and explain your tests.

Finish the first version before expanding the scope.

Try it: Create your project, document setup and ask someone to try it. Record one usability problem and one technical limitation.

Checkpoint: Use feedback and test results to choose your next learning goal.

  1. Choose a goal and a baseline

    Pick a practical outcome such as a text tool, simple game or data organiser.

    Try it: Describe the smallest useful version. Try a short programming exercise and list the concepts you cannot yet explain.

    Checkpoint: Your plan has one concrete outcome and a realistic next study session.

  2. Build the computing foundation

    Learn how data, programs, devices and networks fit together. Work through exercises rather than only watching or reading.

    Try it: Use the on-page computing and programming lessons and keep a notebook of explanations in your own words.

    Checkpoint: Explain a new concept with an example you did not copy from the lesson.

  3. Practise programming and structures

    Use one language long enough to learn functions, collections, errors and testing.

    Try it: Build small solutions with lists and maps. Revisit a previous solution after learning about operation costs.

    Checkpoint: Solve a comparable problem from a blank file and explain your tests.

  4. Build, review and choose the next gap

    Finish the first version before expanding the scope.

    Try it: Create your project, document setup and ask someone to try it. Record one usability problem and one technical limitation.

    Checkpoint: Use feedback and test results to choose your next learning goal.

Learn the core ideas

Read the explanation, follow the worked example, then attempt the exercise before opening its answer. The examples are small teaching cases; they are not reports of measured production systems or completed research.

What this guide covers

Lesson 1 of 6

Understand inputs, state and stored data

A program receives inputs, keeps or changes state and produces outputs. Data in memory may disappear when the program ends; a saved file persists beyond that run. A filename is not its contents. Representations matter: the text “12” and the number 12 can support different operations.

Worked example

A note editor displays a sentence you have typed, but that does not prove the sentence has been written to a file. Closing the program may lose an unsaved edit.

Try it yourself

Describe the input, state, output and persistent storage of a shopping-list program.

Show suggested answer

Typed items are inputs; the current list is state; the displayed list is output; a saved file or database is persistent storage. Define when saving occurs and what the user sees if it fails.

Checkpoint: Explain what exists only during a run and what survives a restart.

Lesson 2 of 6

Use variables, decisions and repetition

A variable names a value used by the program. Assignment changes what a name refers to; it is not a mathematical equality statement. A condition chooses between paths. A loop repeats work while updating state. Trace each iteration instead of guessing from the final line.

Worked example

Start with total = 0. Visit 3, 1 and 4, adding each value. The successive totals are 3, 4 and 8.

total = 0
for value in [3, 1, 4]:
    if value > 2:
        total = total + value
# total is 7

Try it yourself

Change the example so it adds only values greater than 2. What is the result?

Show suggested answer

Test each value before adding it. Add 3, skip 1, add 4: the result is 7. A value exactly equal to 2 must also be skipped because the condition is greater than, not greater than or equal to.

Checkpoint: Predict a loop’s result and explain a boundary condition.

Lesson 3 of 6

Organise work with functions and collections

A function packages one operation with explicit inputs and an output. A list holds an ordered collection; a map associates keys with values. Clear boundaries let you test a calculation without opening an interface or reading a file. State what values the function accepts.

Worked example

count_matches(["red", "blue", "red"], "red") should return 2. The function counts values rather than printing messages, so callers can use its result.

def count_matches(items, target):
    count = 0
    for item in items:
        if item == target:
            count += 1
    return count

Try it yourself

What should count_matches([], "red") and count_matches(["Red"], "red") return under exact matching?

Show suggested answer

Both return 0. The first list is empty. The second contains a different string because matching is case-sensitive. If you want case-insensitive behaviour, specify it and implement it deliberately.

Checkpoint: Write a function contract and separate calculation from input/output.

Lesson 4 of 6

Choose a structure and reason about work

An algorithm is a procedure for a defined problem. Choose a structure for the operations you need: order, lookup, duplicates and updates. Counting operations helps compare approaches, but setup and memory also matter. Start with a correct simple method before optimising.

Worked example

To recognise duplicates in [4, 2, 4], keep a set of values already seen. The third value is already present, so it is a duplicate. A set does not preserve repeated entries as separate values.

Try it yourself

If the task requires the original order and all repeated values, is replacing the list with a set enough?

Show suggested answer

No. A set alone loses multiplicity and does not express the original sequence. Keep the list and use a separate set when you need fast membership checks while preserving the original data.

Checkpoint: Explain what information a data structure keeps and what it discards.

Lesson 5 of 6

Save data and define an interface

Decide how information is stored and what counts as valid input. Parse external text into your internal model, validate it and handle errors at a clear boundary. Do not treat every failure as an empty result; that hides the difference between “nothing saved” and “could not read”.

Worked example

A reading-list file contains one record per book. A missing file might mean first use; a damaged existing file means recovery is needed. Those situations should not silently overwrite the same destination.

Try it yourself

List the steps for loading records from a file without destroying the original if parsing fails.

Show suggested answer

Read the file, parse into a temporary model, validate records and only then replace the current state. Show a useful error on failure and preserve the original file. Define a backup or recovery approach before writing.

Checkpoint: Describe a save/load round trip and a failure that preserves user data.

Lesson 6 of 6

Debug with evidence and build independently

A failing test gives you a small reproducible problem. Compare expected and actual behaviour, inspect the relevant state and change one hypothesis at a time. Keep versions of your work and instructions for running it. A finished project is one another person can understand and use, not simply a tutorial you reached the end of.

Worked example

A function meant to accept ages 18 and over rejects 18 because it uses age > 18. A boundary test isolates the mistake without needing a large dataset.

Try it yourself

Choose three tests for the rule “accept whole-number ages from 18 through 65 inclusive”.

Show suggested answer

Include 18 and 65 as accepted boundaries and at least one rejected value such as 17 or 66. Also decide how to handle non-integers or invalid text. A larger test set should cover both sides and input errors.

Checkpoint: Explain a bug, the evidence for your fix and how someone can rerun the check.

Put it into practice

Make a personal reading-list tool

Keep a list of book titles and reading states using fictional or non-sensitive examples. A command-line interface or a simple local interface is enough.

Project brief

  1. Define add, list, mark-read and save/load behaviours before choosing a framework.
  2. Represent each book with a stable ID, title and state; keep calculations in functions.
  3. Add persistence, duplicate handling and clear invalid-input errors.
  4. Test a restart, an empty list, a changed book and a damaged input file; write setup instructions.

What to produce

  • A small working version you can explain without a tutorial.
  • A trace of one function and tests with expected results.
  • A saved sample file and a documented recovery decision.
  • A notebook entry naming the next concept you need to learn.

Check your readiness

Use evidence, not the number of pages you have read. If one statement is unclear, return to the relevant lesson and try a new example.

  • I can explain a central idea in my own words and trace a new example.
  • I can attempt the exercises and explain why an answer is reasonable.
  • I can test or challenge my work and record a mistake or limitation.
  • I can produce the project evidence and identify the next gap to address.

After the project, deepen mathematics, systems, networking, data management and human factors. The university page gives a broader knowledge map. This sequence is a practical foundation, not a shortcut to every CS topic or a guaranteed job outcome.

Sources and scope

The teaching text, examples and exercises above are provided on Plain CS. These external references document the knowledge and professional guidance behind this selected overview; you do not need to leave the page to attempt its lessons.

  • CS2023 knowledge areas

    Reference for subject breadth. The lesson groups and examples here are Plain CS explanations, not the full curriculum.

  • Official Python tutorial

    Optional language reference for the snippets. It assumes some programming knowledge; the explanations and exercises above are provided here.

This is an introductory guide with practice, not a complete degree, accreditation, professional certification or a substitute for domain-specific instruction. Follow your institution’s or organisation’s requirements where applicable.

References reviewed .

Browse all Computer Science audiences

Image preview

Fit