PDA

View Full Version : Pseudocodes



Yoshi
11-18-2002, 12:31 AM
Who do pseudocode here?

Pseudocode is my arch enemy. **HATE**

face_master
11-18-2002, 12:40 AM
You, sir, are an idiot. Actually, forget I called you sir. Pseudo code is a great tool used by pros and newbs alike - its the best thing to plan out pieces of code. Whats wrong with it??

Yoshi
11-18-2002, 12:41 AM
no, it is too... much work.

OneStiffRod
11-18-2002, 01:05 AM
Psuedo code kicks ACE mofo.

I personally hate to code, I wanna spend as little time writing code as I have to - I just want the end product. Psuedo code allows me to put Pen to paper and plan out my Objects, functions, design of program, and the goal and flow of the functions. I can then sit down and BUST out my program with little time wasted, all I have to do is find the particular STD lib fxn that I need to accomplish this step.

Ppl who don't like psuedo-code don't speak good engrish.

Govtcheez
11-18-2002, 09:00 AM
> Ppl who don't like psuedo-code don't speak good engrish.

w3rd.

Pseudo-code's the best thing since sliced bread. I dare you to make a big project without any kind of pseudo-code, flow charts, or anything else.

Stoned_Coder
11-18-2002, 09:44 AM
Every single thing I write goes thru the design phase. Part of that design phase is always writing pseudocode. I could not live without it. Pretty much all of the professional coders I know do a similar thing.

Shiro
11-18-2002, 12:19 PM
>Who do pseudocode here?

I do, but I don't use pseudo-code a lot, I prefer using diagrams (flow charts and other kinds of diagrams) since it gives me a better overview of the design.

Though pseudo-code is very useful when making a detailed design of an algorithm, because you can use your natural language to describe the algorithm instead of using the programming language.

Prelude
11-18-2002, 12:20 PM
Pseudocode saves you from having to use flowcharts, I'd say that's enough reason to use it.

-Prelude

Shiro
11-18-2002, 12:31 PM
>Pseudocode saves you from having to use flowcharts,

Then how do you get an overview of your software? I prefer diagrams, to get/create an overview of the code. But maybe it's because I have an electronics background that I prefer diagrams. ;)

jdinger
11-18-2002, 12:36 PM
Originally posted by Wraith_Master
no, it is too... much work.

And wasting hour upon hour trying to track down a bug that could have been avoided by proper pre-code planning is not too much work?

:eek:

Depending on what the particular problem is I use both flow charts and pseudo code. Usually when dealing with a large problem I flow chart it. Then as the large problem is whittled down into the individual smaller problems I may (depending on the complexity of the problem) use psuedo code to work out the smaller problems.

FillYourBrain
11-18-2002, 04:24 PM
I think Wraith_Master is coming from the perspective of a school teacher going over pseudocode. I remember when it was taught to me in school and the teacher treated pseudocode as if it needed to have a strict syntax. I rembember serious frustration when being marked off for not following the proper pseudocode structure.

Pseudocode is you're note taking and planning. There isn't a strict syntax it just needs to be readable and understandable. You wouldn't start building a house without first drawing a blueprint would you?

MethodMan
11-18-2002, 04:39 PM
I use it all the time, especially when the code gets a little tricky. It helps to write out what you want to accomplish it just words and then turn that into code.

I was never really taught how to do it, are there any standards for it?

Aran
11-18-2002, 05:07 PM
it's pretty much an a "whatever works for you" basis.

I love to use UML to model my programs before i program them.. i'm a student of OOD so i'm mainly concentrating on effective design now instead of speedy implementation.

Waldo2k2
11-18-2002, 07:24 PM
>>I dare you to make a big project without any kind of pseudo-code, flow charts, or anything else.

how's 20+ pages of source without pseudocode? i never use it, i get down to it and start cranking out code. I start with a basic construct of a program, then work into the logic, then memory, then add glamour.

Whether you use pseudocode really has to do with how you think, i've played chess for years, ever since i could talk. I think that's made me code the way i do. I can think and code at the same time...sometime throwing typing in there at the same time has some weird outcomes lol, i've been known to IM semicolons to my friends quite often.

Hammer
11-18-2002, 07:47 PM
Originally posted by Waldo2k2
how's 20+ pages of source without pseudocode?
That won't work too well in a business environment, at least not in the one I work in. There are other people to consider, who will want to know how you plan to write your code up front. No point in spending hours writing code, when someone in your team takes one look at it and says "that'll never fit in with what everyone else is doing because....". It's about teamwork ;)

face_master
11-18-2002, 11:12 PM
>>
Pseudo-code's the best thing since sliced bread. I dare you to make a big project without any kind of pseudo-code, flow charts, or anything else.
<<

Screw flowcharts. They suck!

Anyways, my retarted teacher is like, "this is exactly how you must do pseudeo code...bla bla bla" and he had it like this:


BEGIN
SUM = 0
INPUT FOO
DISPLAY "this crap"
END
And i'm like "dude, thats just BASIC but you changed some keywords". "Pseudo code can use whatever syntax suits you". And he's like "No. This is how you must do it according to the Psedueo code Standard" (he pulled the "Psedueo code Standard" out of his .........., if you ask me.

Dammit, I ramble so much...

moi
11-18-2002, 11:30 PM
Originally posted by face_master
>>
Pseudo-code's the best thing since sliced bread. I dare you to make a big project without any kind of pseudo-code, flow charts, or anything else.
<<

Screw flowcharts. They suck!

Anyways, my retarted teacher is like, "this is exactly how you must do pseudeo code...bla bla bla" and he had it like this:


BEGIN
SUM = 0
INPUT FOO
DISPLAY "this crap"
END
And i'm like "dude, thats just BASIC but you changed some keywords". "Pseudo code can use whatever syntax suits you". And he's like "No. This is how you must do it according to the Psedueo code Standard" (he pulled the "Psedueo code Standard" out of his .........., if you ask me.

Dammit, I ramble so much...

buahahaha!!!! i use pseudo code in many forms, most often with copious amounts of pencil and paper.

zahid
11-19-2002, 01:10 AM
See. My signature..
Never code before desk work.
-------------------------------------:-->

You have taken the wrong side. It is better as early you get it.

Waldo2k2
11-19-2002, 11:10 AM
>>It's about teamwork
yeah, if you're in the professional world writing with a group of people. Then if i had to write it out for other people i would. For my own benefit is not worth it, i code it, comment the hell out of it as i go and i'm all good...comment's should be pretty good for most people anyhow seeing as i do it for every line the first time through.

Shiro
11-19-2002, 12:14 PM
And i'm like "dude, thats just BASIC but you changed some keywords". "Pseudo code can use whatever syntax suits you". And he's like "No. This is how you must do it according to the Psedueo code Standard" (he pulled the "Psedueo code Standard" out of his .........., if you ask me.


Perhaps he is referring to standardization. If each member of a software development team uses his or her own design methods, then the development will be a real mess. So, for yourself, it doesn't matter, as lang as you understand your own pseudo-code, but it might be harder to understand to others. I can imagine that when the teacher has to check your work, he or she also likes to understand your pseudo-code.

lightatdawn
11-19-2002, 01:17 PM
>>how's 20+ pages of source without pseudocode?

20 pages is small.

I pseudocode anything I havent done before. But my pseudocode is concept based only and simplifies everything to the point where I'm only working on design and not implimentation. Implimentation is easy.

... Hmm... I just thumbed through a stack of notes on my desk and I realise that most of my pre-coding design is merely a classes definition. Apparently it helps me formulate how the class will preform its task and what it will require to do so effectivly while maintaining an appropriate interface with the outside world.

I see a lot of this:

class UntangleLinkedArray

TLIST * HeldList;
unsigned long RecordCount;
unsigned long RowCount;

TLIST * Untangle(TWHOLE ** Source); //Gives back the untangled source in the form of a TLIST. This is all CMap needs before it calls to render.
TLIST * FeedOneRow(TWHOLE * Source); //Returns a single flat row (to Untangle) from the mess it's going to feed it.
HRESULT IsOnTop(TLIST * ThisNode); //Find out if this is an offset element or if it belongs to another row or if its already sorted (by pure fluke). FeedOneRow will need this before it can pop an element out or it wont know where to put it.

Theres more but thats basically it. I see stuff scratched out all over and re-written. That just proves its better done on paper than scrapping entire function bodies. I guess it just helps me get the design worked out so I dont end up smacking myself two days later going "Doh! I cant untangle like that! There could be offset elements inside other rows! How could I be so stupid?"

Anyhow, pseudocode beats the hell out of rewriting something because of a simple design flaw oversite you would have noticed it you'd plotted the classes flow first.