What is pseudocode?

devdrake0

Si

Posted on May 31, 2019

What is pseudocode?

Pseudocode is the representation of code.

What is pseudocode?

Pseudocode is used when you are trying to explain a programming concept, or to describe how you plan on implementing some functionality in your program, without the constraints of making it syntactically correct.

Take almost any previous article on this site and you will find pseudocode. In What are loops we introduced the concept of a list and a loop:

-- list --

recipients = James, John, Jimmy, Jane, Jake, Jemma, Joanne, Juliet, Jessica, Josh

-- Loop --

for $name in recipients {
    Dear $name

    .... body of letter ....
}
Enter fullscreen mode Exit fullscreen mode

As far as I know, neither of these are valid in any programming language, by which I mean if you tried to use them, as they are written above, you'd get errors and the program wouldn't run.

They were added to the articles because it makes the process of explaining much easier. They say a picture says a thousand words, I think the same is true for code examples. Imagine reading all of the previous examples without the pseudocode examples, would you have understood them?

You may now be wondering why use pseudocode at all. If code examples make the process so much easier, why not just write syntactically correct code that can be executed? There are a lot of programming languages out there. We could explain these concepts in one programming language, but then it would only work for that one language. We could explain these concepts in all of the programming languages, but then these articles would become very long and very repetitive.

So we show you the concepts using pseudocode so you can focus on the concepts, not one specific programming language implementation.

Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.

💖 💪 🙅 🚩
devdrake0
Si

Posted on May 31, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What is an else statement?
beginners What is an else statement?

May 31, 2019

What is a switch statement?
beginners What is a switch statement?

May 31, 2019

What are comments?
beginners What are comments?

May 31, 2019

What is pseudocode?
beginners What is pseudocode?

May 31, 2019

What is testing?
beginners What is testing?

May 31, 2019