Pseudowhat?….

Michel Besnard
3 min readMay 1, 2021

--

An introduction to writing pseudocode and how it can help new developers break problems down.

My head is full of ideas. I imagine this incredible scene, full of detail, immersive, interactive, and just plain fun. As a newbie developer, I would then eagerly sit in front of my workstation, fire up Unity, then…nothing. I just wouldn’t know where to begin the process of creating what I’d imagined.

The problem was (other than the obvious fact that I was still acquiring the necessary skills to program) that I would stare at the project as a whole. I didn’t know how to break it down into smaller bite-size chunks. It took me some time to figure this part out, and the process which helped me the most was making use of pseudocode.

So…what is pseudocode?

Like all good efficient parents who wish to encourage their children to find answers for themselves, I turned to Google for the answer. From the many returns received from my query, the one I like the best stated the following:

https://www.wikihow.com/Write-Pseudocode

In other words, it is the plain English representation of a program, a function, or some sort of algorithm, which explains the desired step-by-step flow of the program. Since it’s not associated with any specific programming language, it can be used to simplify in clear terms what the purpose of the code will be. This in itself is great since it will force me, as a developer, to drill down into the logic of the function I’m trying to implement.

There may not be a specific standard or strict method to writing pseudocode, but there are standard conventions that you should try the adopt. Let’s take a quick look at some of the conventions:

  • Use capital words reserved for commands or specific keywords, such as IF and ELSE.
  • Use a single line for each statement. No complicated long-winded paragraph that never ends…
  • Use indentation to isolate your logic.
  • Write in plain English. If a fellow developer needs to pull out a dictionary to figure out a word you typed out, you’re doing it wrong!

How different statements are depicted in pseudocode

Assignment Operators: =, <- or :=

Comparison Operators: ==, !=, <, >, <=, and >=

Arithmetic Operators: +, -, *, /, MOD(%)

Logical Operators: AND, NOT and OR

Sum and Product: Σ and Π

Special Keywords: START, INPUT, PRINT, READ/GET, SET, INIT, INCREMENT, BUMP, DECREMENT, COMPUTE, CALCULATE and DETERMINE.

Conditional Statements:

if

IF condition
THEN if body
ENDIF

if…else

IF condition THEN
if body
ELSE
else body
ENDIF

if…else if….else

IF condition statement THEN
if body
ELSE IF condition THEN
else if statement
ELSE
else body
ENDIF

Iterators:

for loops:

FOR initial_value TO end_value
for body
ENDFOR

while loop

WHILE condition
while body
ENDWHILE

Functions

FUNTION function_name(parameters)
function body
RETURN value
ENDFUNCTION

Again, there are no strict rules to writing pseudocode. Applying standard terminology will only entrench the habit. It organizes your thoughts by allowing you to lay out all the required logic.

Try it out! It’s so much easier to write out your code once you have a plan written out in front of you :)

--

--

Michel Besnard
Michel Besnard

Written by Michel Besnard

Military member with 35+ years of service, undertaking an apprenticeship with GameDevHQ with the objective of developing solid software engineering skills.

No responses yet