General and Web Programming Fundamentals
  • Introduction
  • Program creation and design
    • Program design
      • Algorithms
      • Pseudocode
    • Programming conventions
    • Writing programs
      • Source code editors
      • Integrated Development Environments
      • Code repositories/Version control
      • Compilers/Interpreters
  • Programming Fundamentals
    • Operators
      • Arithmetic
      • Logical
      • Assignment
    • Constants and Variables
    • Datatypes
      • Primitive Datatypes
        • Character
        • Integer
        • Boolean
        • Floating point
        • Nothing (Null)
      • Composite Datatypes
        • Arrays
        • Strings
        • Classes
        • Structs
      • Literals
    • Data structures
      • Lists
      • Queues
      • Stacks
      • Map/dictionary
      • Trees
      • Graphs
    • Control structures
      • Selection (Conditional)
        • If/Else
        • Ternary
        • Switch
      • Iteration (Loops)
        • For loops
        • While loops
        • Do-While loops
        • For-Each loops
    • Functions
      • Parameters and arguments
      • Lambda expressions
      • Higher Order Functions
    • Space and Time
    • Scope
    • Standard libraries
  • Programming Paradigms
    • Procedural (Imperative) Programming
    • Object-oriented programming
    • Functional Programming
    • Declarative Programming
    • Event Driven programming
  • Programming Languages
    • Short history of programming
    • Low-level programming languages
    • High-level programming languages
  • Web Development
    • What is the web?
      • Web browsers (clients)
      • Webservers (serving web pages)
      • W3C
    • Markup languages
      • HTML
        • HTML Tags
      • Cascading Style Sheets (CSS)
        • CSS Properties
      • XML
      • Markdown
    • Scripting Languages
      • JavaScript
      • TypeScript
    • JSON
    • JavaScript Frameworks
  • Acknowledgements
    • About the author(s)
  • License
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Program creation and design
  2. Program design

Pseudocode

Pseudocode in computer programming is a simplified, half-way language that helps developers and programmers to plan and communicate algorithms without the constraints of formal programming language syntax. It's not executable code but a textual representation of an algorithm, often resembling a combination of several programming languages. Pseudocode is primarily used for algorithm development and explanation.

Key Characteristics of Pseudocode:

  • Language Agnostic: It doesn't adhere to the syntax of any specific programming language.

  • Focus on Logic: Prioritizes the logic and steps of the algorithm rather than syntax and programming conventions.

  • Readable: Designed to be easily understood by people familiar with programming concepts.

  • Structured: Often follows a structure similar to high-level programming languages (e.g., use of loops, conditionals).

A Simple Example of Pseudocode:

Let's consider a simple algorithm for finding the largest number in a list:

Algorithm: Find the Largest Number in a List
Input: A list of numbers
Output: The largest number in the list

Begin
    Set largest to the first number in the list

    For each number in the list
        If the number is greater than largest
            Set largest to this number
        End If
    End For

    Return largest
End

In this pseudocode:

  • The algorithm is outlined in a step-by-step, readable manner.

  • It uses common programming constructs like a loop (For each) and a conditional statement (If).

  • It avoids specifics like variable declarations or error handling, which are typical in real code.

  • It's written in a way that can be easily translated into any programming language.

PreviousAlgorithmsNextProgramming conventions

Last updated 1 year ago

Was this helpful?

Page cover image