Skip to content
Learnearn.uk » Home » Written Descriptions, Pseudocode & Program Code

Written Descriptions, Pseudocode & Program Code

Written Descriptions

Written Program Descriptions

Written Description: A written description is a narrative explanation of the program’s logic using natural language. It focuses on conveying the overall flow and behavior of the program without diving into the details of individual steps. It is more suitable for high-level understanding and communication between stakeholders, such as clients, project managers, or non-technical team members. Written descriptions may lack the precise syntax and structure found in pseudocode or programming languages.

Example

"The program prompts the user to enter two numbers. It then calculates the sum of the two numbers and displays the result on the screen."

From the above the developer should be able  to ( perhaps after asking some additional clarification questions) code the program described.

Pros:

  1. Accessibility: Written descriptions can be easily understood by a wide range of stakeholders, including non-technical individuals. They don’t require any programming knowledge or familiarity with specific syntax, making them more accessible for communication purposes.
  2. Flexibility: Written descriptions provide flexibility in terms of language and format. They can be written in plain language or tailored to the target audience, allowing for customization and adaptation to different contexts.
  3. Clarity: Well-written descriptions can effectively convey the overall flow and behavior of a program in a concise and understandable manner. They focus on the program’s purpose, requirements, and expected outcomes, enabling stakeholders to grasp the essence of the program without getting bogged down in technical details.

Cons:

  1. Ambiguity: Written descriptions may be prone to ambiguity or misinterpretation due to the use of natural language. The lack of precise syntax and structure found in programming languages can lead to different interpretations or misunderstandings of the intended logic.
  2. Lack of Detail: While written descriptions provide a high-level understanding of a program, they often lack the level of detail necessary for implementation. They may not capture the specific steps or decision-making processes involved, making it challenging to translate them directly into code.
  3. Difficulty in Validation: Unlike pseudocode or actual code, written descriptions are not easily verifiable or testable. It can be challenging to confirm if the described logic is correct or if it meets the desired requirements without implementing it in a programming language.
  4. Limited Reusability: Written descriptions are not directly executable and cannot be reused as code snippets. They serve more as documentation or communication tools rather than practical implementation instructions.

 

Pseudocode

Pseudocode

Pseudocode is a way of representing a program’s logic using plain language. It helps in understanding the algorithm without getting into the specifics of any particular programming language.

Example – program to add two numbers

1. Start
2. Declare variables num1, num2, sum
3. Read num1 from the user
4. Read num2 from the user
5. Set sum = num1 + num2
6. Display "The sum of", num1, "and", num2, "is", sum
7. Stop

Pseudocode aims to strike a balance between human-readable natural language and structured programming constructs. It helps programmers communicate and understand the algorithm’s flow and logic, making it easier to translate into actual code in a specific programming language.

This program code is easy to read but can easily be converted into fully working code by a developer.  As pseudocode isn’t a real language there is not official set way to write it, since pseudocode need only be logically correct, no syntactically correct.

Edexcel iGCSE Pseudocode

All exam boards here their own versions of psuedocode. Here is the official pseudocode guide from Edexcel. It is important to note that while you don’t strictly need to follow this list exactly when writing pseudocode in the exam, it is highly recommended as otherwise you risk losing marks in the exam.

EdExcel Pseudocode Command List

Pros of Pseudocode:

  1. Readable and understandable by both technical and non-technical individuals.
  2. Provides a clear and structured representation of program logic.
  3. Language-agnostic, allowing for flexibility and adaptability to different programming languages.
  4. Facilitates validation and testing of program logic before implementation.

Cons of Pseudocode:

  1. Subjective and open to interpretation.
  2. Lack of standardization in syntax and format.
  3. May lack implementation-specific details.
  4. Not executable code, requiring translation into an actual programming language.

Program Code

Program Code

Program code is code that can be directly executable (or with a few minor changes) in the target language.

Example

# Read input from the user
num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))

# Calculate the sum
sum = num1 + num2

# Display the result
print("The sum of", num1, "and", num2, "is", sum)

Pros of Program Code:

  1. Precision and Execution: Program code provides precise instructions that can be directly executed by a computer, resulting in functional software or applications.
  2. Implementation-Ready: Program code is the actual implementation of the logic, making it executable and ready for use.
  3. Verifiability: Program code can be tested and validated to ensure that it produces the desired results.
  4. Reusability: Code can be reused in other projects or parts of the same project, saving development time and effort.
  5. Efficiency: Program code is optimized for performance and can be fine-tuned to achieve optimal speed and resource usage.

Cons of Program Code:

  1. Complexity: Code can be complex, especially for large and intricate programs, which can make it harder to understand and maintain.
  2. Technical Knowledge Requirement: Understanding and working with code generally requires knowledge of programming languages, which may pose a barrier for non-technical stakeholders.
  3. Limited Accessibility: Program code may be less accessible and understandable for individuals who are not familiar with programming concepts or syntax.
  4. Less Flexibility: Code is tied to specific programming languages and may require significant changes to port or adapt to other languages or platforms.
  5. Lack of Abstraction: Code focuses on implementation details and may not provide a high-level overview of the program’s logic, making it less suitable for communicating concepts to non-technical individuals.

 

Resources

Resources

Learning & Revision Resource