What Is “Pseudo-Code” And Why Should You Be Using It?
No matter who you are or how good you may be as a programmer, you will always come across parts of your scripts where you’ll need to write notes.
Pseudo-code is a note written to depict the general idea, concept, or logic behind code that you are either needing to write or trying to figure out out to write. Say for example you are faced with a challenging concept to a system and you just can’t figure out how to make it work. By creating a note and trying to flesh out the overarching idea of your code you can lay it out for easier and more detailed analysis and production.
An example of this could be…
Notice how the example shows the actual overarching C# format for an “if statement” but the specific code/details of the player input and what is supposed to happen is written in English. That is because pseudo-code is about fleshing out logic and/or setting reminders for yourself, NOT writing actual functional code. That comes after!
These pseudo-code notes can be used when you have to finish other parts of a system but know that you will have to come back to this part at some point. you can write out the general logic for what you’ll be needing to implement in that spot later so as not to forget the location, as well as the assumed logic needed to accomplish your goals.
I also use pseudo-code as a way to write/puzzle out logic that I haven’t fully figured out yet. If you start writing it outside of notes though, the programming environment can throw errors or even auto-correct things that you know are just temporary statements that will be replaced once you know what is actually going there.