In our journey to technical sophistication, let's talk about one of the most underestimated and under-utilized tool within the tech community-Pseudocode.
What is pseudocode? How does it add to technical sophistication? What are its benefits? This article and the next sets to explain all that. Keep your tea in hand and read.
FreeCodeCamp refers to pseudocode as 'fake code'. Here is the best way to explain what that means:
Computer languauges are written by humans but require syntaxes and rules that must be strictly adhered to for a successful compilation. Humans do not naturally read in computer languages and often make mistakes in following this strict rules. Hence the thought; How can human-techies, write a program that is similar to computer language, flexible and easy to understand? Pseudocode came to save the day. Psuedocode cannot be understood by the computer though.
In very formal terms, Psuedocode is a detailed yet readable description of what a computer program or algorithm must do, expressed in a formally-styled natural languauge rather than in a programming language.
Rules for writing in pseudocode
- Capitalize the initial word.
- Make one statement per line.
- Indentation is very neccessary to show hierarchy.
- Keep it simple, short and readable.
- write in the naming format not in computer language format.
- End multiline structures using END keywords.
Steps to follow when solving a problem in pseudocode
- Understand the question: This is the most important part of the process, if the question is understood, half of the problem is solved and you are ready to take up the challenge.
- Break the problem down: Smaller tasks help to get the work done. The more smaller tasks you solve, the closer you are to the full solution.
- Understand what the function does: The work of a function is to accept data as input, work on it with steps and return output. The more functions you study, the easier it gets.
- Indicate what you need to solve the problem.
- Document the high-level solution: This is an excellent way to walk it out.
- Evaluate and indicate the outcome.
- Detail the step for executing the solution.
Congratulations! You are a step closer to being a sophisticated techie.
In the next article, we will get our hands on real life examples and the benefits of Pseudocode with links to practice section. See you there!
Top comments (0)