Pseudocode

The purpose of using pseudocode is that it is easier for people to understand than conventional programming language code, and that it is an efficient and environment-independent description of the key principles of an algorithm.

Flowcharts, drakon-charts and Unified Modelling Language (UML) charts can be thought of as a graphical alternative to pseudocode, but need more space on paper.

Textbooks often include an introduction explaining the conventions in use, and the detail of pseudocode may sometimes approach that of formal programming languages.

Depending on the writer, pseudocode may therefore vary widely in style, from a near-exact imitation of a real programming language at one extreme, to a description approaching formatted prose at the other.

This flexibility brings both major advantages and drawbacks: on the positive side, no executable programming language "can beat the convenience of inventing new constructs as needed and letting the reader try to deduce their meaning from informal explanations", on the negative, "untested code is usually incorrect".

For example, the sum operator (capital-sigma notation) or the product operator (capital-pi notation) may represent a for-loop and a selection structure in one expression: Normally non-ASCII typesetting is used for the mathematical equations, for example by means of markup languages, such as TeX or MathML, or proprietary formula editors.

Examples are: Some array programming languages include vectorized expressions and matrix operations as non-ASCII formulas, mixed with conventional control structures.