Importance of Pseudo code

Pseudo code for Player movement

Often times, whenever we start on a project, we want to jump right in. We want to start coding, writing, cooking, drawing, and when we do, our minds might go a mile a minute. This burst of dedication drives us to complete whatever is on our mind and yet, it is because of this burst of dedication that can blind us to see the overall picture. We can write hundreds of lines of code, but if we don’t achieve our goal, all the time spent would be for naught. This is where Pseudo Code comes in.

Pseudo code is essentially a description what the logic should do. Similar to creating an outline or making a rough sketch, pseudo code should be written before creating the actual logic.

Because Pseudo code is syntax-free and thus not compiled when running the application, you can use plain English when writing pseudo code. However, there are two schools of thought on how pseudo code should look like:

This one is in plain English. Anyone can determine what is going on, even if they have little to no knowledge of programming.

Although this example is also in plain English, because it incorporates programming syntax into it, it might make it harder for those with little to no knowledge of programming to determine what is currently going on.

  1. Creating a layout of what you want to achieve: By writing pseudo code, you’re laying the foundation of what the logic should be doing when you’re done.
  2. The point between your mind and the computer: Sometimes, we know what we want to do but don’t know how to achieve it. By writing pseudo code, it allows us to jot down our ideas so, in the future, we can incorporate it into the logic. After all, you’re just “translating” the pseudo code to actual code.
  3. Easier to debug the logic: It helps out in two ways. First, it helps by ironing out the logic even before we start writing code. If something seems off when writing pseudo code, then it’s likely will cause a bug when writing code. Second, it can help pinpoint where the bugs are after compiling. For instance, if the player movement is off the mark, pseudo code can help us focus on the part that might be incorrect rather than going line by line.
  4. Better communication: If you’re working in a team that has members who may not have a deep programming background as you, it’ll make it easier for them to go through your code almost step-by-step and determine what is going on.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store