What is Pseudo-code, and why would you want to use it?

One of the mistakes some beginning developers make is trying to type entirely in code right from the beginning. They should write it out in pseudocode first, possibly by commenting it out, then use that as a guide to writing the actual code. One example would be what to do if a player reaches zero health. The pseudo-code could look something like this.

You would then use that to generate the actual code to destroy the player logically. That may be something like this.

If this were included in a script attached to the player Gameobject then when the variable playerHealth reaches zero or below, it would destroy the gameobject, effectively killing the player.

As you can see, writing things out in pseudo-code can help you work out what you want to do in plain English then more easily translate that into code.

I hope you have found this article helpful and at least a bit informative. Thanks for reading, and good luck on your coding journey.

I'm a Unity developer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

ENSW Tryouts .. How I learnt to fail.

Understanding VPC and how to operate securely on the cloud (Part 1 — Introduction)

Path to Desmos Mainnet

How to config?

Miniblog: Python Syntax Refresher

Working on Rails

Solidity Development: Setting up environment

Create a virtual host for Apache on Windows(Windows 10) using XAMPP.

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
Brian Branch

Brian Branch

I'm a Unity developer.

More from Medium

Galaxy Shooter 2D — Boss (Set up)

From Prototype to Work of Art

Adding Effects to our player

Why Use Pseudo Code? Think Of It Like A Shopping List