We introduce pseudo-code (not a particular programming language) as a sketch language, and show some typical programming constructs.
Note:It also shows the difference between a for-loop-construction and a while-loop-construction. A for-loop iterates over a set of elements and a while-loop continues as long as a condition holds.
The constructions we use in our pseudo-code look very similar to constructions
that are used in programming languages.
This is no surprise, because these programming languages are supposed to
support the constructions we use in our design.
The introduction to pseudo-code we gave here can therefor be very useful in
an introductionary course on programming.
Although the pseudo-code shown above more or less resembles imperative
programming languages, it can also be used for functional languages,
like the list processing language Lisp.
Then we need a slightly different notation.
Mind though that such a functional language is not different from an
imperative language. The computational model for a functional language is
the sequential evaluation of list expressions.
If we consider a program in an imperative language as a list, we replace
any loops with a recursive function, and eliminate the use of placeholders,
then it all looks the same. Off course, the reverse is also possible.
We can adept our sketch language to our favourite style for programming.