Skip to main content

Pseudocode

Grades: All
Estimated Duration: 11-20 minutes, 21-30 minutes, 30+ minutes

Table of Contents

All
Check for understanding, Comprehension, Practice, Synthesis, Visual aid
Any
Individual, pair, small group
Optional

Description

Pseudocode is a set of instructions written in simplified programming language to represent the flow and operation of a program. It helps students to write the steps of an algorithm using a mix of technical terms and plain English without focusing on syntax. Pseudocode follows the structure of a programming language but can be easily written and understood by any programmer, novice or expert. This strategy simplifies the planning stage for computer programs and helps students to test a concept, recognize errors in structure, and problem solve before they convert the pseudocode to a programming language that can be read by a computer. Using pseudocode as an instructional strategy helps students to understand programming logic and the structure and key elements of code without worrying about the conventions of a particular programming language. Essentially, students map out a program using their own words.

When To Use It

As a learning strategy, use pseudocode when you want students to:

  • plan out the algorithm for a computer program or app before writing it in a formal programming language
  • create an algorithm in an easy to read format using keywords and programming language structure
  • explore and test the programming logic of an idea for a computer program
  • solve problems in an algorithm that uses simplified programming language before converting it to a formal programming language

As an instructional strategy, use pseudocode when you want to:

  • introduce students to writing computer code using programming language structure and keywords
  • teach students programming syntax and programming concepts
  • evaluate students’ ideas for computer programs and algorithms before they write formal code
  • help students communicate their ideas for computer programs using simple programming logic

How To Use It

Advance Prep

  1. Identify the goals and objectives of your computer programming lesson.
  2. Create a problem statement for students to address using pseudocode. Give them a clear task and instructions for the program they will design (e.g., FizzBuzz Challenge).
  3. Create a model(s) of pseudocode to demonstrate how students can represent algorithms using simple language. Although there are no formal rules for writing pseudocode, it is still helpful to include some common features for students to communicate meaning and flow that will eventually be converted to a formal programming language. There are some standard conventions that programmers follow when writing pseudocode. Consider providing students with pseudocode reference sheets, such as those from the College Board.
  4. Plan to walk through how to write pseudocode using keywords and programming logic and structure. Discuss the following concepts:
    1. program – a set of instructions that perform a specific task when executed
    2. statements: instructions for the computer program, one statement written per line
    3. mathematical operations – math symbols used to manipulate values
    4. conditionals: add logic to your code using IF or IF/ELSE or ELSE statements
    5. iteration: repeating set of instructions to generate a sequence of outcomes or loops (e.g. FOR loops and WHILE loops)
    6. functions: reusable code
    7. exceptions: code for catching and reacting to errors
    8. program wrapping – wrapping several functions into one program to improve readability

Include keywords that refer to common coding concepts, such as:

  • START/BEGIN
  • INPUT
  • READ/GET –
  • PRINT/DISPLAY/SHOW
  • CALCULATE/COMPUTE/DETERMINE
  • SET, INIT
  • INCREMENT/BUMP
  • DECREMENT
  • PROGRAM
  • END

Follow these conventions:

  • Capitalize initial commands or keywords.
  • Write one statement per line.
  • Use indentation to show hierarchy.
  • Use specific, simple English in each statement

Implementation

  1. Introduce the concept of pseudocode to students. Model simple examples of pseudocode developed to address different problem statements.
  2. Review programming concepts, keywords, and pseudocode conventions as you model the examples. Post/provide concepts, keywords, conventions, and examples for students to reference as they write their pseudocode.
  3. Give students a problem statement for designing their program using pseudocode.
  4. Have students partner or work in small groups to review each other’s pseudocode to evaluate logic and flow.
  5. Have students share and discuss their pseudocode with the whole group to check for understanding and address misconceptions.
  6. Provide additional opportunities and problem statements for students to practice programming logic and flow using pseudocode.
  7. When your students are ready, show them how to convert the pseudocode to a formal programming language such as Python, JavaScript, or C++.

Pros

  • Makes understanding the logic behind computer programming accessible to diverse learners
  • Can be created outside of a programming environment
  • Makes reading, writing, and understanding what a program intends to do easy
  • Helps with converting program ideas/plans to a formal programming language

Cons

  • No standard format or style
  • May be difficult for novice programmers to follow the logic without a visual aid like a flowchart or storyboard

Culturally Responsive Application

Allowing students to use pseudocode to represent the algorithm for a computer program aligns with culturally responsive teaching. Because the premise of using pseudocode is to use one’s own words and syntax to describe a program’s logic, students can learn programming logic using language that makes sense to them. Using pseudocode makes learning the basics of computer programming more relevant and accessible. It also helps to break down barriers of entry for underrepresented students in computer science education by providing a non-intimidating introduction to computer programming that prepares novice learners for formal programming challenges.

Emerging English Language Support

We can use pseudocode to scaffold the learning of programming concepts.

Students with Disabilities Support

Used as a detailed step in the process of developing a program. It allows designers or lead programmers to express the design in great detail and provides programmers a detailed template for the next step of writing code in a specific programming language (Techtarget, 2005).

Subjects

5.4 Algorithms & programming

Why It Works

Instructional pseudocode helps students to develop problem solving strategies.(REF82). Structured pseudocode helped most students find it more natural to learn how to write programs (REF83).