Pseudocode and its importance

S. Jackson
2 min readSep 28, 2017

Pseudocode Introduction

Pseudo coding is the process of using comments in your code in order to keep track of what is actually going on. One might say that pseudocode is a bit ‘extra’, but it has its purpose. Pseudo coding allows not only the person writing the code, but also the reader, to understand what’s happening inside of the code. Everyone have their own coding style, and some are harder to read than others. Although we strive to have clean code where each line is self explanatory, sometimes that does not happen — this is where pseudocode shine!

What is Pseudocode?

Pseudocode is the conversion between computer and human language, but it is a conversion we make ourselves. As said in the introduction paragraph, pseudocode help people understand what is going on inside of your code. Pseudocode is generally comments implemented inside of the code to keep track of what is actually happening. For example, sometime we may have a loop nested inside of another loop running in our code. That can be a bit confusing if the person does not explicitly state what is happening, so here would be a good time to pseudocode a comment about what is being looped through. Now you might ask, how do I pseudocode code? We will cover that in the next section.

Syntax

Pseudo coding does not have a particular syntax, and this is because it does not matter to a certain extent how you write it because the computer does not read pseudocode. Pseudocode is strictly for ease of readability. While pseudo coding does not particularly have a certain syntax, there are still some rules we must follow. For example, in different programs there are different ways to write comments. In JavaScript we use the ‘//‘ forward slashes to write one single comment while we use ‘/* */‘ to write comments that expand over a couple of lines. It is required that you properly use this way of commenting or else your computer will give you an error. Remember, pseudocode can not be read by the computer, so when we insert our forward slashes we are telling the computer that this is a comment. The computer will skip over it and run the program as normal. If you do not let the computer know that it is a comment, it will try to understand the code and subsequently throw an error.

To wrap it up..

Pseudocode are comments placed inside of programs in order to produce ease of readability. We use pseudocode not only for ourselves but for others that are working with us or will be working on the same project at a later date. There are no syntax rules for how a comment must be written, but it must be written using either forward slashes or forward/back slash with an asterisk at both its beginning and ending. When the computer hit a comment, it skips over it and proceeds to the code, this is why it is important to add those front/back slashes and asterisks when appropriate. One last thing, you can pseudocode anywhere inside of your code!

--

--

S. Jackson

Database Administrator | Web Developer | Software Developer