Why you should be writing pseudocode

Dennisse Pagán Dávila
CodeX
Published in
3 min readMar 22, 2021

What is Pseudocode?

A simple way of writing the logic of an individual statement, a set of statements, or even entire programs in your natural language. Pseudocode does not require programming syntax or any other complex structures, which makes it extremely easy for anyone to use.

Example:

Pseudocode: Compare the number of apples with the number of oranges, if the number of apples is greater than the number of oranges, then show a message saying there are more apples. Otherwise, show a message saying there are more oranges.

Code:

Pseudocode can also be written in comments when programming:

What is it used for?

Pseudocode is a way to create a draft or outline of what you need your program to do, and an excellent problem-solving tool. By stating your programming needs in simple terms, you can break down complex problems into their most basic forms and build up your solution step by step.

The pros of using Pseudocode

  • Anyone can understand it. All types of programmers, no matter what their main programing language is, can take a look at pseudocode and flesh out coherent syntax from it.
  • Documentation is fundamental and vital in any software development industry. Pseudocode is extremely helpful in the rough draft documentation of work.
  • Breaking down complex problems for better solutions.
  • Can be used to explain each line of code, not only making the early stages of development easier but improving the knowledge and understanding the programmer has over the program.
  • Makes the code more readable.
  • One of the best and most common ways to implement an algorithm.
  • Can be used to transition from flowcharts to actual code.

Tips on writing pseudocode:

  1. Be concise but elaborate; strive to be less abstract and ambiguous. It’s ok to be less strict when working on your own, although it is advised that you make sure you understand your own writing. When working with other programmers, they will need you to be as clear as possible.
  2. Try to use proper nomenclature/naming conventions. If a programmer in your team picks up your pseudocode, when possible, you should specify what is meant to be a variable, a method, or otherwise.
  3. Use simplified programming terms when possible to help visualize the logic. Some of these include ‘if-then’,‘case’, “while”, “for”.

Like in the previous example: “ if the number of apples is greater than the number of oranges, then show a message”

--

--

Dennisse Pagán Dávila
CodeX
Writer for

Software Engineer that specialize in Game Development. Currently looking for new opportunities. Portfolio: dennissepagan.com