COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY

COMPUTATIONAL THINKING | THINKING PROCEDURALLY

ON THIS PAGE
SECTION 1 | IDENTIFY THE PROCEDURE APPROPRIATE TO SOLVING A PROBLEM. 
SECTION 2 | EVALUATE WHETHER THE ORDER IN WHICH ACTIVITIES ARE UNDERTAKEN WILL RESULT IN THE REQUIRED OUTCOME. 
SECTION 3 | EXPLAIN THE ROLE OF SUB-PROCEDURES IN SOLVING A PROBLEM.
 
ALSO IN THIS TOPIC
YOUR ARE HERE | THINKING PROCEDURALLY
 THINKING LOGICALLY
THINKING AHEAD
 THINKING CONCURRENTLY​ 

THINKING ABSTRACTLY
 FLOWCHARTS
MORE COMING SOON

Picture
SECTION 1 | IDENTIFY THE PROCEDURE APPROPRIATE TO SOLVING A PROBLEM
When tackling any problem in computer science (and, really, in many areas of life), it's crucial to break the problem down into manageable steps and ensure those steps are in the correct sequence. This is the essence of procedural thinking.

1. Breaking Down Problems
Any complex problem can often be made more understandable by dividing it into smaller, more manageable sub-tasks or steps. Each of these smaller tasks can then be tackled individually.

For example: If you're coding a game, you might break it down into:
  • Designing the user interface.
  • Developing game mechanics.
  • Coding character movements.
  • Implementing game scoring.
  • Adding music and sound effects.
2. Sequencing
Once you've identified the steps, it's vital to determine the correct order in which they should be executed.

For example: When baking a cake (a non-computer example, but a useful analogy), you can't just randomly choose when to mix ingredients, preheat the oven, or decorate the cake. There's a specific order to follow for the cake to turn out right.

3. Visualization Tools
Visual aids like flowcharts or block-arrow diagrams can help in conceptualizing the flow of the procedure.

Block-Arrow-Block-Arrow: This is a simplistic way to demonstrate procedural flow. Each block represents a step or action, and each arrow points to the subsequent action.
For instance, in a recipe:
Preheat Oven to 350°F
↓
​
Mix dry ingredients
↓

Add wet ingredients and stir
↓

Pour batter into greased and floured pan
↓
Bake for 30-35 minutes, or until a toothpick inserted into the center comes out clean
↓

Let cool completely before frosting
... and so forth.
SECTION 2 | EVALUATE WHETHER THE ORDER IN WHICH ACTIVITIES ARE UNDERTAKEN WILL RESULT IN THE REQUIRED OUTCOME
​When embarking on a task, especially in computer science, it's essential to be certain that the steps you're taking will lead to the desired outcome. This involves both prediction (thinking ahead) and sometimes even executing multiple tasks simultaneously or considering multiple factors at once (thinking concurrently).

THINKING AHEAD
This means planning and forecasting the possible outcomes of a decision before actually executing it.

Example: When writing code, it's essential to anticipate potential errors or bugs. If you're creating a software application that needs to handle user data, you might think ahead about potential security risks and plan to encrypt that data.

THINKING CONCURRENTLY
Concurrency, in computing, refers to the ability of a system to handle multiple tasks at the same time. In a broader sense, thinking concurrently means considering several factors or tasks simultaneously to achieve an optimal solution.

For example: When designing a multi-threaded application, you'll need to think about how different threads might interact, share resources, and potentially conflict with each other.

Algorithm Design: Involves predicting the outcomes of various operations, ensuring that they produce the desired results. This is an example of thinking ahead.

Concurrency and Parallelism: In program design, especially with the rise of multi-core processors, concurrency is a significant consideration. It requires the programmer to think concurrently, ensuring that tasks running simultaneously don't interfere with each other in undesirable ways.

It's crucial to anticipate the outcomes of different parts of your code. For instance, understanding that a certain piece of code will change a variable's value, and predicting how that change will affect the program downstream.
SECTION 3 | EXPLAIN THE ROLE OF SUB-PROCEDURES IN SOLVING A PROBLEM
Sub-procedures, often called subroutines, functions, or methods in various programming languages, play a pivotal role in problem-solving, especially in programming and algorithm design. Here's why they're crucial:

MODULARITY
Sub-procedures promote modularity. Instead of having a long sequence of code or instructions, you can break down a problem into smaller, more manageable chunks. Each chunk, or module, can be tackled independently.

For example: If you are designing a calculator program, instead of writing a single long piece of code, you might have sub-procedures for addition, subtraction, multiplication, and division. Each of these sub-procedures handles a specific operation.

REUSEABILITY
Once a sub-procedure is defined, it can be used multiple times without needing to rewrite or duplicate the code. This promotes code reusability and reduces redundancy.

For example: In the calculator program, once you've written the subroutine for addition, any part of the program can use it by referring to its identifier whenever addition functionality is needed.

ABSTRACTION
Sub-procedures allow for a level of abstraction. The main routine or other sub-procedures don't need to know the details of how a specific sub-procedure works, just what it does (i.e., its interface).

For example: If you're using a sorting subroutine, you don't necessarily need to know the inner workings of the sorting algorithm. You just need to know that it will sort your data.

EASY DEBUGGING AND MAINTENANCE
By isolating functionality into separate sub-procedures, if there's a bug or an error, it's often easier to locate and fix. Maintenance becomes more straightforward because changes to one sub-procedure don't automatically mean changes to the entire program.

IMPROVED RELIABILITY
Programs that utilize sub-procedures are generally easier to read and understand. Each sub-procedure has a clear purpose, and by naming them descriptively, the flow and functionality of the program become clearer.

PASSING PARAMETERS
Sub-procedures can accept parameters (inputs) and return outputs. This allows for flexibility and dynamic behaviour. By changing the parameters, you can change the behaviour of the sub-procedure without altering its internal code.

CONSTRUCTING PROCEDURES REFERRED BY THEIR IDENTIFIER
When you define a sub-procedure, it's given a unique name or identifier. This identifier acts as a reference to the set of instructions encapsulated by the sub-procedure. By invoking or calling the sub-procedure using its identifier, you execute those instructions. This methodology simplifies complex tasks and promotes the principles mentioned above like modularity, reusability, and abstraction.

Sub-procedures are fundamental building blocks in programming and algorithmic problem-solving. They help break problems into smaller, more digestible parts, making code cleaner, more efficient, and more maintainable. By defining and then referring to these procedures by their identifier, programmers can tackle complex challenges in a systematic and organized manner.
Picture
Identifying and Sequencing Procedures
1. When solving a problem, why is it essential to break it down into manageable steps and ensure these steps are in the correct sequence? Provide an example.[5]

Thinking Ahead and Concurrently
2. Explain the difference between "thinking ahead" and "thinking concurrently" in the context of programming. How do these approaches impact the design and execution of a program?[5]

The Role of Sub-Procedures
3. What is a sub-procedure, and why is it beneficial to use them in programming? Provide an example of a problem that can be efficiently solved using sub-procedures.[5]

4. How do sub-procedures contribute to the modularity and reusability of a program? Illustrate your answer with an example from a real-world application.[5]

Integrative Question
5. Imagine you are tasked with designing a program for a library management system. Describe how you would:
  • Break down the problem into steps.
  • Think ahead to anticipate potential issues.
  • Utilize sub-procedures to handle specific tasks like checking out a book or searching for a title. Explain how naming and referring to these sub-procedures by their identifiers would be beneficial.[8]
Picture
ALSO IN THIS TOPIC
COMING SOON
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.