I've seen a lot of mentions of Pseudocode lately, on this site and others. But I don't get it:

What is Pseudocode? For example, the Wikipedia article below says "It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading." Does this mean that it isn't actually used to make programs?

Why is it used?

How is it used?

Is it considered a Programming Language? See the above Wikipedia quote.

Please provide specific quotes and questions from the Wikipedia article. All of your questions are answered there. If you can't understand the words or phrases, please quote a specific word or phrase in your question so we can explain it. It's difficult to know what you found confusing in that article. Rather than repeat that article here, it would help if you could reference the specific things that confused you.
–
S.LottFeb 22 '12 at 10:58

8 Answers
8

Pseudocode is, as the name implies, not real code, but it looks like code. It helps people to understand a problem domain or solution better without having to add all the baggage necessary when using a real language.

In short: it's used only for illustrational purposes.

Pseudocode and programming
There is no definition or fixed rule of pseudocode, it can be different each time. It is not a (real) programming language and no-one will consider it one. It cannot be compiled or used as a real programming language: if you could do that, it ceases to be pseudocode. Pseudocode does not need to be deterministic (a necessity for computers to compile), it rather needs to be understood by humans. To use pseudocode, you'll have to convert it to your favorite programming language. This conversion process can be different each time and no rules can be given for it because, again, pseudocode is like free speech: it can take any form.

Usages
It is commonly used, especially in the design phase of projects to help understand a certain approach to a problem. It's also commonly used in algorithm design, or when teachers draw something on the board. In all these cases it is not necessary to compile the code, you just want to understand the problem/solution.

Types of pseudocode
Pseudocode can be, but doesn't have to be of a certain type, i.e., you can have a stack-based pseudocode to illustrate MSIL, you can have an imperative pseudocode to illustrate Java, C#, C++, Python, you can have a functional pseudocode to illustrate F#, Haskell, SQL etc.

Examples
From the top of my head, but anything goes, because pseudocode can be invented on the spot:

It might be worthwhile to add that pseudo-code can live on any level of abstraction: You could describe the specific workings of an algorithm in a way that is easily translatable to real non-pseudo code, or you could give a very high-level overview of some approach using very broadly defined "methods" or "objects". It's a wide spectrum.
–
Joachim SauerFeb 22 '12 at 12:02

What is Pseudocode? For example, the Wikipedia article below says "It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading." Does this mean that it isn't actually used to make programs?

It is exactly that, it's code written in a human friendly form.
It cannot be used to make a working program.

Why was it made/is it used?

Because Pseudocode is quick to write and quick to read. As it doesn't have language specific parts its clearer to read. Its also language independent so anyone can read it (for that reason its used in a lot of text books)

Is it considered a Programming Language? See the above Wikipedia quote.

No. A programming language requires more than just structure. It requires formal semantics, which pseudocode lacks.

Is it commonly known/used?

Yes. Anyone above a junior level should know how to read/write pseudocode. Its essential for reading a lot of text books and planning code in a team.

The best example of Pseudocode was when I shared an office with a FORTRAN programmer, while I was programming in Pascal. Anytime we helped each other we had to write it in Pseudocode.At the time I didn't know FORTRAN so there is no way for me me to get the syntax correct (especially all the indents required locations for specific marks). He never had to write with semicolons. On the whiteboard we wrote in a Pseudocode so that it could be understood, without getting bogged down on complex syntax rules.

The are no strict constructs for Pseudocode. If the writer knows a language that uses "{" after an if statement they put it on the board, if they know python they don't. The goal is to quickly sketch out the basic approach to the problem, not absolutely correct code.

Teachers can use it to give guidance to a student, without giving them the correct answer. Once you know more then one language Pseudocode should be natural to use while sketching out code fragments.

Pseudocode is not a language, not a convention. Every textbook or paper would use its own version of the pseudocode. As with many other informal mathematical "languages", in the best case it would be informally described in the paper itself, in the worst case the authors would expect it to be "obvious" enough.

In the bestest case it is obvious enough to not require any formal or informal description ;).
–
AbelMar 22 '12 at 10:35

@Abel, there is no such a thing as an "obvious" formalism. Even something as "obvious" as decimal arithmetics must be properly introduced. Otherwise confusion is unavoidable, unfortunately. I've never seen an unambiguous pseudocode without at least some formal introduction attached.
–
SK-logicMar 22 '12 at 11:34

This thread is about pseudocode. Formalism has nothing to do with that. But my comment was "pun intended" ;).
–
AbelMar 22 '12 at 11:35

@Abel, an abstract language is a formalism too (at least when used in a more or less scientific paper).
–
SK-logicMar 22 '12 at 11:37

Pseudo code is basically written instructions of what a program should do to complete an operation. The pseudo code is written in your speaking language. You simply write down the steps of an algorithm or procedure to make it easier for you or someone else to read it and convert it to a real programming language.

Why was it made/is it used?

It was made to help you specify the steps of a procedure, process or an algorithm without using a programming language. One possible alternative is to use flowcharts.

Is it considered a Programming Language?

No, it’s not a programming language, since there are no formal rules.

Is it commonly known/used?

Personally, I always try to use pseudo code when writing algorithms or complex procedures.

-1 Not helpful. The quote only makes sense among an explanation of pseudocode (missing in this answer). Otherwise, it could be quite misleading. A newbie could wonder: well, C#'s methods are all in English, so that means the C# I'm using is Pseudocode, right...? What do they call it when they're using C# in Germany?
–
doppelgreenerMar 1 '12 at 0:49