An algorithm is a specification of computations operations to accomplish a particular objective. While algorithms can be expressed in many ways in theory, the implementation of most programming languages share some common traits.
For example, most programming languages are “sequential” in the sense that a subsequent operation cannot start until the one before it is completed. Algorithms do not inherently require this restriction applied universally, but the implementation of processors and computers can only perform operations sequentially (from the perspective of a processor core). As a result, most practical programming languages incorporate this restriction.
Other traits will be discussed in this class in steps.
Instead of using an existing programming language for this class, pseudocode is used. Pseudocode literally means “pseudo” (not real) “code” (algorithm steps). This means that pseudocode is not a real programming language, and may never be understood by any computer. It does not seem to make sense to learn programming without using an actual programming language, right?
Pseudocode is used for two important reasons.
Now why is that a “feature”?
When we learn concepts in programming, it is important to figure out what a program is going to do using our minds instead of just running the program to figure out what it does. The use of pseudocode makes sure that programs cannot actually on a computer. This forces the programmer to track down the execution of the code manually. It is by this means the instructor can assess whether a concept is understood correctly.
Real programming languages have fairly strict syntax enforcement. This means that if you forget to close a parenthesis, or use a comma instead of a semi-colon, or use the wrong indentation, the computer reports a “syntax error” and the code does not run.
Pseudocode has a more relaxed syntax because it only needs to be understood by a person. As a result, small deviations from the ideal syntax is not a big problem.
This helps to reduce the mental strain and stress originating from writing syntactically perfect code so that more energy can be spent on understanding concepts.