5.5 Flexible syntax

Because pseudocode is not meant to be understood by a computer, its syntax (grammar) does not need to be exact. In other words, we don't need to use a semi-colon to end all statements (in C), or to use the := symbol to mean assignment (in Pascal), or to use prefix format even for expressions (in Lisp).

You get the idea.

Pseudocode is meant for people (computer scientists, programmers and etc.). As such, as long as it is clear what a symbol (or group of symbols) mean, there is no need to be too exact. Even though I am used to a particular ``flavor'' of pseudocode, I can still pick up a computer science textbook or journal and understand algorithms expressed in other ``dialets'' of pseudocode.

Another advantage of pseudocode is that the writer does not have to spend time or energy to ensure little details are done right. Thoughts like ``should I use a semicolon here?'' or ``what is the assignment symbol'' distracts the mind from the process of developing algorithms.


Copyright © 2006-09-05 by Tak Auyeung