Pseudocode: How It Can Help Students Learn to Be Better Programmers
Imagine you’re an architect building a house. Where would you begin? Would you start digging the foundation and putting up walls first? No way! Architects need to initially create blueprints to plan what the house will look like and to help guide the entire process.
When starting new software projects, software developers also create plans to stay organized and have a greater understanding of everything that's involved. Instead of diving in and coding right away, developers use something called pseudocode to make sure all the necessary information and details are clearly outlined first.
What is pseudocode?
Pseudocode is the practice of writing down what a particular computer program is going to do. It's written in English and is intended to be clear and simple. Pseudocode's purpose is to help break a software problem or project down into more manageable parts, stay organized, and ensure nothing important is forgotten.
Pseudocode can be written out for any programming language, whether it's a text or block language. You can write pseudocode on a whiteboard, on paper, or on any preferred medium. Developers take the finished pseudocode and subsequently convert it into real code.
Benefits of pseudocode
1. Writing pseudocode prior to starting a project is a great way to find flaws and discover missing details before any code is written.
2. It's also extremely helpful to outline a plan when collaborating with others on a project and ensure all teammates involved are clued into the plan.
3. Teachers can review students' pseudocode to see what students are working on and notice areas where students might need support.
4. Pseudocode is useful for students who have trouble getting started. Students can reference their pseudocode whenever they get stuck on what to do next.
5. Writing pseudocode is part of teaching students good programming habits and will allow kids to practice real-world, problem solving skills used by software developers today.
Examples of pseudocode
This simple pseudocode below is intended for a Scratch program.
Pseudocode Example 1:
When the green flag is clicked,
If character is touching the wall
Else (in all other cases)
Grow ten times larger
Pseudocode Example 2:
Set the score to zero
When the green flag is clicked, keep repeating the following forever:
If character is touching blue
Increase the score by one point
Teaching students how to write pseudocode is a great way to help them become stronger, more thoughtful programmers. Not everyone’s pseudocode will look exactly the same and that’s okay! As long as the pseudocode clearly outlines what a student’s program is going to do and is easy to read, that is sufficient. The more students practice writing out pseudocode, the easier and more natural it will become.