Pseudocode is a set of sequential written human language instructions, usually numbered, that is used to describe the actions a program will take when it is coded in a programming language. The word "pseudo" means "fake," so "pseudocode" means "fake code." The algorithm in the pseudocode helps programmers or nonprogrammers determine the step-by-step actions a program must take to complete a required or desired action.
Advantages of Pseudocode
Programming languages are difficult to read for most people, but pseudocode allows nonprogrammers, such as business analysts, to review the steps to confirm the proposed code matches the coding specifications. By writing the code in human language first, the programmer safeguards against leaving out an important step. Some programmers write pseudocode in a separate document, while others write directly in the programming language using comments before the actual code. This provides a handy reference during coding.
Disadvantages of Pseudocode
While pseudocode is easy to read, it does not provide as good a map for the programmer as a flowchart does. It does not include the full logic of the proposed code. A flowchart includes decision structures and looping structures in the code, with indications of the next step, depending on the answer to the previous step. Since it is basic by nature, pseudocode sometimes causes nonprogrammers to misunderstand the complexity of a coding project. The lack of standards is probably the main disadvantage of pseudocode. Pseudocode is by nature unstructured, so the reader may not be able to see the logic in a step.
Video of the Day
Who Can Write Pseudocode?
Any logical person can write pseudocode, even with no coding skills. However, it requires a detailed thought process and complete understanding of the task. Think about how you do simple tasks like driving to the park. If you write "get in the car, drive to park, stop," your pseudocode is incomplete. Pseudocode must account for every action and decision. For example, you must describe which of your cars to drive, how you get to the garage and into the vehicle, and the specific steps to start the car and operating the vehicle. In addition, the pseudocode should specify whether you drive forward or back out of your driveway and describe the distance, starts, stops and turns. Upon arrival, the pseudocode indicates where to park. Every step must be written down in the pseudocode.