Jump to content

what is pseudocode

Joshcanread

Pseudocode (sometimes written as pseudo-code) is a description of the source code of a computer program or an algorithm in a language easily understood by humans.

It uses the general structure of a computer programming language, but omits details that are required by machines to execute the code. The primary purpose of writing pseudocode is to enable humans to understand the computer program or algorithm without having to understand the programming language.

 

https://simple.wikipedia.org/wiki/Pseudocode

Link to comment
Share on other sites

Link to post
Share on other sites

It also makes porting easier since you are effectively just describing what the actual source code does.

 

Psuedocode is something like this...

 

create variable x

ask for user input

store user input in variable x

find the square root of x

display variable x

Link to comment
Share on other sites

Link to post
Share on other sites

Its more readable code that usually wont run in any programming language. However python is 90 % similar to pseudo code so some code is same as in python.



Here is example of pseudo code.

Quote

for element in list:
     print i

And here is "real" code in most languages.

Quote

 

for (index=0; index>list.len; index++)

{

print(list[index]);

}

 


So as you can see usually it means that () ; {} and other symbols are removed from the code for easyear reading and understanding.
So basicly fake code to explain some concept or coding logic

 


 

Link to comment
Share on other sites

Link to post
Share on other sites

It is a middle point between a textual representation of the algorithm and the actual code. The goal is to allow you to see the flow the code will have once written without the intricate details like what encoding to use and things like that.

 

This allow you to spot errors and to apply this model to any languages. So in a team meeting when you are 50 devs in the rooms no one need to understand the code. The pseudo code is not specific to 1 language (there are exception when it's technology specific but should still be understandable).

 

It allow you to take one of you dev buddy and ask him if you miss something when you are blocked somewhere and he should understand.

Link to comment
Share on other sites

Link to post
Share on other sites

A way to teach coding without really programming but still coding.

Learnt it in college last semester, it was fun.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×