Pseudocodes (Guidelines, Advantages & Disadvantages)
Pseudocode is structured English for describing algorithms concisely. It is made up of two words, namely, pseudo meaning imitation and code meaning instructions. As the name suggests, pseudocode does not obey the syntax rules of any particular programming language i.e. it is not a real programming code. It allows the designer to focus on main logic without being distracted by programming languages syntax.
Guidelines for Preparing Pseudocode
Following points should be remembered while preparing pseudocode :
- Pseudocode will be enclosed by START (or BEGIN) and STOP (or END).
- Pseudocode should be concise so ignore unnecessary details.
- To accept data from user, generally used statements are INPUT, READ, GET or OBTAIN.
- To display result or any message, generally used statements are PRINT, DISPLAY, or WRITE.
- Generally used keywords are capitalized while preparing pseudocode.
Example of Pseudocode
Pseudocode : Calculation of Simple Interest
Step 1: START Step 2: READ P, T, R Step 3: I = P*T*R/100 Step 4: PRINT I Step 5: STOP
Advantages of Pseudocode
Preparing pseudocode while solving any problem through computer has following advantages :
- It allows the designer to focus on main logic without being distracted by programming languages syntax.
- Since it is language independent, it can be translated to any computer language code.
- It allows designer to express logic in plain natural language.
- It is easier to write actual code using pseudocode.
- Unlike algorithms, pseudocodes are concise so pseudocodes are more readable and easier to modify.
Disdvantages of Pseudocode
Pseudocode has following disadvantages :
- There are no accepted standards for writing pseudocodes and designer use their own style while writing pseudocodes.
- Pseudocode cannot be compiled and executed so its correctness cannot be verified by using computers.