Pseudocode — Why It’s So Important
Pseudocode is used to explain what your lines of code are meant to do. It is best practice to always use pseudocode when coding. Typing out your pseudocode, before your actual code, helps keep you on track with your coding task.
So Why is Pseudocode So Important?
If your code is to be shared with a team, or if you come back to your code to check on a possible error, it’s much easier to find your block of code if you used pseudocode. This is why most seasoned coders always use pseudocode.
Pseudocode is written in a format just as you would write your spoken language.
When writing your pseudocode in Visual Studio, or your code editor of choice, you begin each line of pseudocode with a double forward slash ‘//’. The ‘//’ lets the editor know that the current line with the ‘//’ is only a comment or pseudocode. The editor knows to ignore commented lines when compiling your code. Below is an example of pseudocode in Visual Studio.
Some pseudocode can be cleaned up (deleted) after your code is written. Other pseudocode is best to keep intact for later reference to particular blocks of code. The more you code, the better you will understand which comments/pseudocode to keep, and which to delete.
I hope this article helped you understand what pseudocode is and why you should make it mandatory in your coding/scripting.