The importance of pseudo code

Plan, plan, plan…then code.

Pseudo-code is a way of planning out the steps needed to accomplish a given task in plain English before attempting to write it in code. It can be like a blue print for what you are trying to do. It is often helpful for programmers to start with pseudo-code because it forces you to think though a problem without the programming-language specifics clogging up the intention of what you want to accomplish.

Simple pseudo-code

It can also help you keep track of the steps you need to write as you fill out the code for each section of pseudo-code you had written down. One problem many programmers face is jumping directly into coding and then relying on searching the internet to find answers to problems that would be easily solved with a little thought first.

Implementation of pseudo-code

Once you’ve thought through your solution and coded it out the pseudo-code is no longer needed and can be removed to help clean up the readability of the code.

Pseudo-code removed

Next Time!

For a simple example like the one above the process may seem contrived but when working with larger solutions or more complex logic or logic with multiple logic branches it can really help in working out and keeping track of your solution. If you enjoyed this article, or want to come along with me as I progress on my journey, follow me at gamedevchris.medium.com.

Unity Game Developer, Software Engineer, Gamer, Musician, and Father. Christopher is a creative that enjoys a challenge and loves coding.