What You Need to Know About Pseudocode
Tags: pseudocode, programming, beginners, codenewbie
Published: 2022-05-20 14:35:22

Many non-tech people think that software engineers solve problems by opening their software and spending hours clacking their keyboards. They think of it as something that requires no stress at all. If wishes were horses, software engineers would clack endlessly!

Software engineers spend most of their time analysing problems and breaking them down into smaller bits. They need to create solutions and understand the structure of the code before any line of code is written in any programming language(s).

They create these solutions using pseudocode.


![How people think I code vs How I really code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0of49gc7u5377f5etqc.jpg)

### What is Pseudocode?
Pseudocode means fake code. It is simply writing out algorithms without strictly adhering to the syntax rules of any programming language. You do not need to worry about technicalities. However, ensure that any programmer can understand it.

### Uses of Pseudocode

- To plan programmes
- To reduce coding errors
- To enable a smooth development process

### Forms of Pseudocode
There are many forms of Pseudocode, but I will consider three.

- **Flowchart Method**: This is the graphical illustration of an algorithm. It uses connected symbols to show the flow of a process. Software engineers use this method to think through the process of a particular function.

The diagram below is the flowchart of an algorithm that checks for even or odd numbers.

![Flowchart of a program that checks for odd or even numbers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61sb58xbnbgrmao564j3.jpeg)

- **Write-up Method**: This type of pseudocode uses more words. Software engineers use this method to think through the chronological process of code.

The snapshot below is the write-up pseudocode of an algorithm that checks for even or odd numbers.

![write-up of a program that checks for odd or even numbers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sb5fmn9zqreym1wor20i.jpeg)

- **Functionality Planning Method**: This involves writing out the main features you want your users to have when using your programme, including functions and smaller programmes you need to make those features work. This method is a notch higher than the flowchart method.

The snapshot below is the functionality planning pseudocode of a banking programme.

![functionality planning pseudocode of a banking programme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fh0h6ixnw0yfcxonsbl.jpeg)

### Rules of Pseudocode
Yes! Rules! Whereas there are no strict rules guiding the use of pseudocode, there are some salient points to note, so the whole purpose is not defeated.

1. Take advantage of programming shorthand like IF, ELSE, ELSE IF etc.
2. Let naming be simple and distinct.
3. Use the correct sentence casings, such as CamelCase for methods, upper case for constants and lower case for variables.
4. Don't overly generalize so that it does not appear abstract.

### References

- _[https://www.futurelearn.com/info/courses/block-to-text-based-programming/0/steps/39492](https://www.futurelearn.com/info/courses/block-to-text-based-programming/0/steps/39492)_

- _[https://easycppprogramming.blogspot.com/2011/07/flowcharts-in-computer-programming.html](https://easycppprogramming.blogspot.com/2011/07/flowcharts-in-computer-programming.html)_

- _[https://www.freecodecamp.org/news/introduction-to-computer-programming-and-computer-science-course/](https://www.freecodecamp.org/news/introduction-to-computer-programming-and-computer-science-course/)_

- [_https://www.geeksforgeeks.org/how-to-write-a-pseudo-code/_](https://www.geeksforgeeks.org/how-to-write-a-pseudo-code/)