Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importance of Pseudocode

Status
Not open for further replies.

darr01

Programmer
Oct 24, 2001
28
MY
hi, guys. I am currently taking a diploma course, which includes C programming. During our tutorials and assignments, I notice that my lecturer stresses quite a bit about the importance of writing pseudocode. However, from what I have done so far, I felt that writing pseudocode is quite a tedious affair. Many times, if I need to include psuedocode into my assignments, I would write the programming code first before writing pseudocode. I know this is the wrong way of doing it but bottom line is - I just dislike pseudocode!

My questions are:
1) Just how important is it to write pseudocode (not only in C language but other languages as well) during actual program development?

2) How many developers working in the software development industry employ pseudocode into their development process?

Thanks,

Darryl HB
 
It is my opinion that pseudo-code is personality based. I, like yourself, hated pseudo-code. I avoided the teachers in college that lived for pseudo-code and I HARDLY ever use it. When I do use it, I do NOT write a novel on the function. I write a quick blub saying what I want it to do. If I know that when I read it I will remember certain things like x will be swapped with y or the new value will be the sum of the previous 2 values (fibonacci) I will not include that. Pseudo-code in my opinion is meant to act as a string around your finger. If you tie a string around your finger to remind you to pick up bread and cheese after work, do you write bread and cheese on your hand? NO! The string says it all.

Well, I could go on and on about this but I will stop now :).

Just my 2 cents
Matt
 
Hi, Matt. Thanks for the input. Reason why I ask this question is that since I am a beginner in learning C programming, I don't want to create any bad habit that will be difficult to unlearn later.

Regards.
 
Please keep in mind it is just my opinion. As i said, some people benifit from it. it all depends on your personality. And I do use it, just not often. It is more like a quick note instead of a paragraph to describe something that will be 3 lines of code.

Matt
 
I think for small problems as in your tutorials pseudocode may not be necessary. It's just another tool that you can use whenever appropriate. Even if you don't want to use it all the time now for small stuff, you probably should get to know how to use it for when you do more complicated stuff.

I think pseudocode can be very helpful. Keep in mind that you don't have to follow the exact syntax of the pseudocode using your own words if you feel like it. I think a lot of companies have their own style that they force you to use.

Pseudocode lets you think of what you have to do to solve a problem not about how you would do it with C. So this gives you a level of abstraction letting you focus on the bigger picture which is very helpful with complicated projecs.
 
In my bigger programming days I almost never used Psuedo-code. If you have to for a class then you have to but it's not useful in and of itself.

If you find you have trouble with with a problem it never hurts to write a little bit on what you want a function to do, including things like what the variables the function is being fed, and what you expect it to return for a value but not usually more than a few lines of real english.

I never saw any value in writing psuedocode that took up more pages than the actaul code. Why some profs love that sort of thing is beyond me.

Of course I've never worked on anything REALLY mammoth, programming wise. So maybe if you want to make commercial grade software that you are collaborating with a team of folks on then psuedocode is a good idea.

But I stilld doubt it :)
 
Being a beginner to C I find that it's complexity is too much for me to write it the same way i would throw an awk or tcl script around. The typedefs, declaration of variables,pointer variables, and mem allocation ideas
are personally quite difficult to focus on in free code
mode. So I write pseudocode to explain what I need to do.

I would love to be able to freely write C without having to do this but so far it is a slow process.
 
You guys have been great. Thanks for all your responses.

Darryl
 
Pseudo-code is to a programmer what a scetch is to an artist or a draft to a writer. It allows you to think and design in terms of required capibilities instead of a specific language's limitations. It lets you focus on the big picture rather than slave over details. This in turn lets you find relationships that may make completing the details easier. Realizing these insights early reduces the rework you could face when you realize them later.

I've been in programming and analysis for both systems and applications for over 20 years and almost always use pseudo code to design. You may blame my use on the number of languages I have at my beck and call, but I even use it when the design indicates a need for only one language.

Wil Mead
wmead@optonline.net

 
Hi Darry

I wont stress the pros and cons of writing pseudocode. However I would recommend u something which should be followed by every programmer. Its Documentation.

Whenever u write a program do ensure that at the begining of the program u write the name of the program, followed by the the purpose and the program logic (may be in brief).

This would help you in documentating the programs later on when u have completed the project. Also this helps u to read your own code a year later and understand what the program does, in case of any changes u require to carry out.

You can also follow the brief documentation procedure for any logic portion which u feel was complicated and this becomes some sort of pseudocode for u.


I hope the above tips should help you in a long way.



icici
:)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top