Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Pseudo?

Author
Message
C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 12th Nov 2006 23:06
What does pseudo mean?

Everyone's using it for like codes and stuff and google gives an unclear definition.

What does it mean!?


http://www.soharix.homestead.com/
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 12th Nov 2006 23:23
In terms of coding - its like a human-friendly language. Sort of simplified with implied parts (like you'd refer to a function called "fireGun" without the code to show exactly what it does). Its often used to show structure..

http://en.wikipedia.org/wiki/Pseudocode

[center]
C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 12th Nov 2006 23:28
Ahh, thats good, thanx


http://www.soharix.homestead.com/
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 13th Nov 2006 00:14
We were learning about it in class recently. My friend thought the teacher was saying Sudoku.

The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 13th Nov 2006 00:28
Another way to think about it is fake. The way I learned it, the prefix pseudo means fake. For example, pseudonym means fake name. (My pseudonym is George Felgar.) In the same way, pseudo-code means fake code. for example if I were telling you a basic way to code something, but didn't want to type out the code, I might do it like this:



Something like that you know? Anyway, I didn't read it, but I'm sure the wikipedia thing is good enough, just thought I'd pitch in my two cents.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 13th Nov 2006 00:38 Edited at: 13th Nov 2006 00:39
A good way to set it out (the way I learned) is like this:

start with your basic algorithm (numbered)

expand (nmbered with points)

for example:



The dude guy
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: In the streets of sasatuin
Posted: 13th Nov 2006 01:18
I might take a look into this, but how exactly do you USE pseudocode? Do you need to download a program that can compile it or something?
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 13th Nov 2006 01:31
No mate, pseudo code is just another form of "design". There are no rules for it, there is no structure, there is no compiling it. It's simply a method of planning code (not coding) in a human friendly way, so that anyone can read it. It doesnt even have to relate to code. You can use it in a way for problem solving too, like instructions to make a paper aeroplane, or flat-pack funature. You dont need to learn it, or read up on it, you just need to be aware of the concept, see a use for it, and try it out yourself.

Next time you think "Hmmm, how should I go about coding XYZ" instead of hacking code together, open up notepad and write out simple short statements that describe each step of what you want to do ... break it down further, add some more details ... write a bit of logic in there .... you're pseudo coding.


Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 13th Nov 2006 01:31 Edited at: 13th Nov 2006 01:35
Quote: "I might take a look into this, but how exactly do you USE pseudocode? Do you need to download a program that can compile it or something?"


You don't 'use' it.

It's not real code, it's origin was for helping in designing programs (i.e. you work out the algorithms before having to write the code itself), that way you can speed up development when actually programming them.

For example, if I wanted to write a program that calculates the amount of tax, I might write the following psuedocode:



That won't run, it's sole purpose is so I can go over it with a number of 'test cases' and ensure it will work flawlessly. So, for example, I can test this algorithm (the method of calculating tax) by assuming certain things:

If my income is $5000, my tax should be $0. So I'd use my psuedocode and manually go over it as if the AnnualIncome were 5000. If I get the correct answer by working it out manually then the algorithm works, and I can start development on the real program. However, usually I'd need to do a number of test cases to ensure all scenarios work correctly (so far, I haven't tested what happens if I get taxed 10% so I'm not sure it works, yet), but how many tests I want to do usually depends on the complexity of the algorithm.

Because the algorithm has already been worked out, using the psuedocode to program it (in C++, DarkBASIC, PHP, etc.) will be much easier because you don't have to do the nutting out as you go.

Most indie coders won't use psuedocode but many professional developers do because the benefits are definitely worthwile, even if they may not look like it at first glance.


"Computers are useless, they can only give you answers."
The dude guy
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: In the streets of sasatuin
Posted: 13th Nov 2006 01:32
Ok, I get it, thanks.
Kenjar
19
Years of Service
User Offline
Joined: 17th Jun 2005
Location: TGC
Posted: 13th Nov 2006 11:35 Edited at: 13th Nov 2006 11:44
This is a rough bit of pseudo code I created about a year and a half ago for a 3D Astroid's game I was making for my own education.



So basically it's just a way of listing what needs to be done in the whole program. I can then work along the list, and turn it onto real life code.

I lay upon my bed one bright clear night, and gazed upon the distant stars far above, then I thought... where the hell is my roof?

Login to post a reply

Server time is: 2024-11-17 21:49:41
Your offset time is: 2024-11-17 21:49:41