Why you should be writing pseudo code

We’re very fortunate these days when reading code, especially with languages like C#; it’s actually fairly readable to humans. When it comes to writing code, however, it can be tricky to stare at that blank class wondering where to begin.
Enter pseudo code.
Pseudo code is a way of noting in plain language what you want to achieve with your code. It’s a bridge between design and implementation when it comes to software development. You can plan what you want to happen in as an outline for creating the actual code.
Let’s look at an example with player movement.

From our design, we know we want to use the WASD keys for movement. We break that down into individual keys. We write what we want those keys to achieve. Simple and understandable.

Instantly we can see that ‘if’ we press a key something happens, so we know we will be working with ‘if’ statements. We can fill that in and, if necessary expand the pseudo code inside.

We now can figure out how to actually perform the action. We translate the position up whenever W is pressed. We can now repeat this for each of the keys to get the final result we wanted to achieve.

So by using pseudo code to plan out our controls and working logically through it we can translate our plan to functioning code.
Pro tip: do not copy this code directly, it will make for a horrible movement system!