RedLectern topic

Programming

Learn to describe problems, write programs, organize data, and improve code.

For: Learners at any starting point, including people with no programming experience.

After this page you can: Choose a learning path and plan, write, test, and revise a small program.

Page reviewed

Part of: Computer Science

About Programming

Programming is the work of turning a problem description into instructions a computer can carry out. Learners break tasks into smaller steps, represent a solution in pseudocode or code, and practice revising it as they learn. The aim here is to connect the ideas behind a program with the choices made while writing one.

Start with problem solving and core programming ideas, then explore Python as one language for putting those ideas into practice. Continue into data structures, testing, and version control as your goals grow. The computer science hub offers wider context; data science, artificial intelligence, and machine learning are related paths to explore.

Start here

route

I’ve programmed before and want a refresher

Use the official Python tutorial to revisit the language’s syntax and features, choosing the topics you need.

Start with: The Python Tutorial

route

I want to keep track of project changes

Read the opening chapter of Pro Git to learn what version control records and how it can help you revisit earlier work.

Start with: Pro Git: About Version Control

Learn the foundations

1.Turn problems into algorithmsBreak a task into steps before choosing code, then examine how an algorithm works and how its efficiency can be considered.

Break a task into steps before choosing code, then examine how an algorithm works and how its efficiency can be considered.

Algorithm

A set of instructions for solving a problem or producing an output from input.

Pseudocode

A human-readable way to describe instructions for a computer.

Try it

Write steps for finding the smallest value in a short list, then try them on [4, 1, 3].

Start with 4 as the smallest seen; compare 1 and then 3. The smallest value is 1.

2.Practice programming with PythonUse a language’s basic features to express calculations, decisions, repetition, and reusable functions.

Use a language’s basic features to express calculations, decisions, repetition, and reusable functions.

Function

A named block of statements that can be called to carry out a task.

Control flow

The order in which a program’s statements are carried out.

Try it

Describe a function that takes a number and returns twice that number.

For input 4, the function multiplies by 2 and returns 8.

3.Choose structures for dataLearn how collections organize values, and choose a structure that fits how a program needs to store or retrieve information.

Learn how collections organize values, and choose a structure that fits how a program needs to store or retrieve information.

  • Data Structures

    This lesson provides a focused introduction to data structures.

List

A mutable sequence typically used to store a collection.

Dictionary

A collection that uses keys to look up values.

Try it

Choose a structure for storing each person’s name and phone number, then give a sample entry.

Use a dictionary keyed by name, such as {"Lee": "555-0100"}.

4.Check and track your workTest a program’s response to selected inputs, then use version control to record changes and revisit earlier versions.

Test a program’s response to selected inputs, then use version control to record changes and revisit earlier versions.

Test case

A check for a specific response to a particular set of inputs.

Version control

A system that records file changes over time so earlier versions can be recalled.

Try it

For a function that doubles its input, name one test input and expected output.

Test input 4 and expect output 8.

Explore subtopics

Latest

No recent updates are available.

See the sources list

Books

Glossary

Every free Programming course and book on RedLectern

Free Programming online courses

  1. A Gentle Introduction to Programming Using PythonMIT 6.189 · Browse materials
  2. Adventures in Advanced Symbolic ProgrammingMIT 6.945 · Browse materials
  3. Building Programming Experience: A Lead-In to 6.001MIT 6.090 · Browse materials
  4. Computational Methods of Scientific ProgrammingMIT 12.010 · Browse materials
  5. Computational Methods of Scientific ProgrammingMIT 12.010 · Browse materials
  6. Dynamic Programming and Stochastic ControlMIT 6.231 · Browse materials · Video
  7. Effective Programming in C and C++MIT 6.S096 · Browse materials
  8. Integer Programming and Combinatorial OptimizationMIT 15.083J · Browse materials
Show all 27 coursesShow fewer courses
  1. Introduction to C Memory Management and C++ Object-Oriented ProgrammingMIT 6.088 · Browse materials
  2. Introduction to Computer Science and Programming in PythonMIT 6.0001 · Browse materials · Video
  3. Introduction to CS and Programming using PythonMIT 6.100L · Browse materials · Video
  4. Introduction to Mathematical ProgrammingMIT 6.251J · Browse materials
  5. Introduction To MATLAB ProgrammingMIT 18.S997 · Browse materials · Video
  6. Introduction to Programming in JavaMIT 6.092 · Browse materials
  7. Multicore Programming PrimerMIT 6.189 · Browse materials · Video
  8. Nonlinear ProgrammingMIT 15.084J · Browse materials
  9. Nonlinear ProgrammingMIT 6.252J · Browse materials
  10. Parallel Programming for Multicore Machines Using OpenMP and MPIMIT 12.950 · Browse materials
  11. Practical Programming in CMIT 6.087 · Browse materials
  12. Programming LanguagesMIT 6.821 · Browse materials
  13. The Battlecode Programming CompetitionMIT 6.370 · Browse materials · Video
  14. A Gentle Introduction to Programming Using PythonMIT 6.189 · Open on OCW
  15. Biological Engineering ProgrammingMIT 20.180 · Open on OCW
  16. Introduction to Computer Science and ProgrammingMIT 6.00 · Open on OCW
  17. Introduction to Computer Science and ProgrammingMIT 6.00SC · Open on OCW
  18. Programming for the PuzzledMIT 6.S095 · Open on OCW · Video
  19. Robocraft Programming CompetitionMIT 6.370 · Open on OCW
How these courses are chosen

Listed as Programming courses:

  • those whose title contains “Programming”, or
  • those tagged “Programming” as one of at most 2 topic tags, or as the first of 3.

Free Programming textbooks and books

Show all 60 listed booksShow fewer books

Search all 67 Programming books on the Books page →

Questions and comments