PDA

View Full Version : Poll: Is pseudocode really needed ?



Nutshell
01-07-2002, 08:58 PM
Poll: Is pseudocode really needed? How often do people use
pseudocode before writing their programs?

quzah
01-07-2002, 09:41 PM
It depends. I do at times, but not every time. Often though. It's helpful as a quick outline to just throw together so you know what you want the program to do:


initialize port
bind port
listen on port
while ! shutdown
listen for new connection
accept new connection
call select
for each connection
read input
parse input
execute command
send output


And now you have the pseudo code for a small telnet server...

Quzah.

zahid
01-08-2002, 03:22 AM
Practicing it is much better for being a good programmer as I have learned.

Even I do not do it everytime but trying to make is a habit. It saves time from possibility of wasting it.

zahid
01-08-2002, 03:31 AM
Originally posted by quzah

And now you have the pseudo code for a small telnet server...


Yeah.. Birds eye view.

Which is must
to never be lost.

QuestionC
01-08-2002, 07:52 AM
Unless I already know how to code what I am going to be coding, then yes... definately yes. How much I get into the pseudocode really depends on how big whatever I'm doing is, although generally it just amounts to C code, with incorrect syntax. I've had the best experience with this sort of pseudocode since it's rigorous enough to be correct, translating it into real code is pretty simple, and it keeps my functions small.

Basically, pseudocode stops you from coding monolithic programs.

Govtcheez
01-08-2002, 08:28 AM
Moved because I think it's more appropriate here...

Oh, and I use pseudocode whenever I write any program longer than a few lines.

Yoshi
01-08-2002, 09:35 AM
Pseudocode is needed b4 you program.

Justin W
01-08-2002, 10:37 AM
Well, I'll break the mold and mention that there are a lot of other ways to design your program, and many of them work better in my opinion. I think pseudo code is a pretty worthless way to design an object oriented project, for instance..

Design before coding is a must, however.

Stoned_Coder
01-08-2002, 12:20 PM
I have used pseudocode for many years almost everytime i code and will continue to do so for many more years.

Shiro
01-08-2002, 01:00 PM
I never use pseudo code. In my opinion there are much better ways to design software. Mostly I use flow charts, or for larger designs UML. They give a much better overview of the software to be developed.

Nick
01-08-2002, 02:26 PM
For designing algorithms use psudocode, for programs it's too time consuming.

lightatdawn
01-08-2002, 03:16 PM
I use pseodocode on occasion. Usually when i'm away from home and inpiration strikes me and i have to write out the genius solution to something-or-other. Unfortunatly sometimes it comes on such a basic level that it tends to look something like this (slightly exaggerated, maybe... a little...):


startgame();
setupgameparameters();
while (still_playgame)
{
check_player();
do_actions();
show_map();
}

Which is the real drawback of pseodocode... Its not code. It doesnt encompass all the issues you're going to get into. A lot of times something looks simple in pseodocode but then you realize that its not going to work out that way in real code. Its still handy for getting your thoughts straight though. I tend to plan stuff out in my head while i eat lunch or something. Or wander around the house looking like a crazy-man as i hold a one man conference out loud to myself.

One things for sure though. You cant go wrong with planning things out. But if my masses of paper recycling is any indication then i should never run into an unforseen catch... hya! right! :rolleyes:

DISGUISED
01-08-2002, 05:04 PM
We are required to submit flowcharts and pseudocode for every project at my college. I think it's good to plan out your logic. Just because your syntax is correct doesn't mean your program is doing what it is intended to do and good planning can help you to avoid this.

Many people at school never do the flowcharting/pseudocode before coding the program. They stuggle to complete the program and then create the flowcharts/psuedocode from their completed source for submission. I find this funny because this is the exact opposite of what we are taught.

doubleanti
01-08-2002, 05:22 PM
for the most part, i think that it shouldn't need to be used since it's my practice to minimize a function's scope. however if organizing a project's functions does not hint at the program's overall functionality, pseudocode is helpful indeed!

also for describing a program, we should all use pseudocode! also, if you are describing something to a newbie, use pseudocode! :) it'll give them the answer, but force them to think. talk in generals :)

gnu-ehacks
01-08-2002, 06:29 PM
I try to, but every time I do a project, I'm always too lazy.

-KEN-
01-08-2002, 08:30 PM
I never knew what pseudo-code was before this post...I had actually never planned a single one of my programs out before!!

Wow...learn something new everyday, huh?


I'll definately start using it :)

zahid
01-08-2002, 11:54 PM
I'm surprised & happy to know that such a senior member like you is getting something to learn from the board. I'm inspired.

IcyDeath
01-09-2002, 06:17 AM
>>I never knew what pseudo-code was before this post...I had actually never planned a single one of my programs out before!!

Neither did I...
Does it help at all?

Shiro
01-09-2002, 12:52 PM
The main purpose of pseudo-code is to present the algorithm in your own natural language. And often no care is taken of the final programming language. It's just describing an algorithm in your own words. But since many programmers do already think in an algorithmic way, I don't think it is very valuable.

Troll_King
01-09-2002, 02:16 PM
Since I'm now using the 100% OOP language called C# I'll be creating 'Use Cases' and 'UML diagrams', but not too much pseudocode or flowcharts. They are antiquated!

Shiro
01-09-2002, 02:25 PM
You are using UML? I also use UML, though I program in C++. Not pure OOP, but for electronics it's better than C# or Java.

What kind of elements of UML do you use most? I often only use the class diagrams, state diagrams and sequence diagrams.

QuestionC
01-09-2002, 02:45 PM
Geez, I dunno about you guys, but if you ask me... the REAL purpose of pseudocode is so that you have something to do on your notepad during class.

And drawing pictures counts as pseudocode too, so nyeh.

Troll_King
01-09-2002, 02:53 PM
What kind of elements of UML do you use most? I often only use the class diagrams, state diagrams and sequence diagrams.


Those and Use Cases. They are the main UML diagrams although there are others. I have the Booch/Rumbaugh manuals. Also, I strongly disagree that C# will not be utilized for embedded systems. For one thing I noticed that Windows CE.NET is now available.

-KEN-
01-09-2002, 03:40 PM
>>I'm surprised & happy to know that such a senior member like you is getting something to learn from the board. I'm inspired.<<

Well I've never had a school course in anything but VB (urgh, I still get sick remembering I took that...I feel dirty...must...get...clean!). They don't exactly teach you anything useful like pseudo-code in a VB course :rolleyes: ...but thanks.

basilisk
01-09-2002, 04:23 PM
i tried using pseudocode in the first couple of months of learning to program but i found it a bit too simplistic and something that i wrote in pseudo code would then need to be completely reworked in the actual program as it didnt work in reality.

I think if you use it or not is often according to if you have had a formal education in c/pascal etc etc programming. People who have learned programming at school/university etc may use it more as they began learning to code by using it. Those of us without a formal programming background therefore 'wing it'

Troll_King
01-09-2002, 04:27 PM
When you start OOP, try Use Cases and UML. Their utility is much clearer but they are not useful for procedural languages like C although perhaps the Use Case is, but not the UML diagrams.

zahid
01-09-2002, 10:01 PM
I guess the starter will be encourage to rephrase his question.

The perspective of the question was to have some preparation before doing code. For C it's pseudocode even for C++..(if not a huge where OO is not involved). But when OOP.. ?

What is OOP? where concept is the main stream. As I have leaned for last 8 months almost all are theories on .................................................. ...................................

Methodologies for object-orientation
Requirements modeling
Finding candidate objects
Candidate objects- Modeling heuristics
Objects: state,behavior,life-cycle,identity
Preparing Data Dictionary
Object modeling & CRC analysis
Objects, messages and methods-the object/message paradigm
Attributes values and domains
Attributes values and domains- modeling heuristics
Class- class versus instance methods and attributes
Class- general UML notation
Classes- modeling heuristics
Associations- modeling heuristics
Aggregations- modeling heuristics
Constraints- modeling heuristics
Inheritance- modeling heuristics
Abstract versus concrete classes
Single versus multiple inheritance
Extension versus restriction inheritance
Inheritance- general UML notation
Inheritance patterns- dimensions
CRC analysis
Responsibility analysis
Collaborations
Collaborations graphs
Dynamic modeling-topics
Messages and responses
Message Sequence Diagrams
State transition diagrams
Relation sequence diagrams
Relation dynamic model/CRC Cards

And .........................................

Design Activities
System design
Technical architecture
Application architecture
Weak coupling- information hiding
Client-server versus peer-to-peer
Layered Construction
Metrics about structure and size of a class
Tree impurity
Yin and Winchester design measure
Shepperd's refinement of the Henry-Kafura measure
Fenton's global coupling measure
Application architecture - frameworks
CommonPoint (Taligent)
The Model-View-Controller framework
Application architecture - design patterns
Design patterns
Design patterns Vs Frameworks
Representing associations
Representing Constraints
Representing Inheritance
Derived data policy
Add redundant associations
Eliminate associations
Rearrange computation
Persistence
Detailed CRC Cards

.................. What all things.
All I have got is that the preparation to sit for doing code.

When you got a CRC Card.. does anyone think that pseudocode is comparable with it?

Here the starter asked for non OO programming or small application programming or problem solving or function level where target is code < 500 lines. (As I have understood)

Shiro
01-10-2002, 12:42 PM
>Geez, I dunno about you guys, but if you ask me... the REAL
>purpose of pseudocode is so that you have something to do on
>your notepad during class.

:-)

Besides to me pseudocode and the use of diagrams isn't the same. However, UML is a language just as natural language is. Then diagrams are also pseudocode. Well, isn't everybody doing pseudocode then?

Shiro
01-10-2002, 12:44 PM
>When you start OOP, try Use Cases and UML. Their utility is >much clearer but they are not useful for procedural languages >like C although perhaps the Use Case is, but not the UML >diagrams.

Well, some UML diagrams are very useful in procedural languages. The state diagrams and sequence diagrams for example.

-KEN-
02-28-2002, 06:33 PM
Someone set an expiration date for this poll and close the thread. Someone has bumped it with a vote...