Shop OBEX P1 Docs P2 Docs Learn Events
Is Pseudo Code a standard or whatever comes to mind? — Parallax Forums

Is Pseudo Code a standard or whatever comes to mind?

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2006-04-28 15:36 in General Discussion
Recently I have seen a lot of Pseudo Code being posted.
I realize it is a useful way of sketching out an idea, but it finally occured to me that there appears to be no real standard to this.· It might look like C or Basic or Java or whatever.

Is that true?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-04-28 15:16
    The code you see isn't technically pseudo-code, it is typically a situation where the poster doesn't want to goto the effort of syntax checking the code and therefore writes the code in a style they are familiar with. There actually is a stardardized form of psuedo code, but its too high level to be useful for most examples. In the formal structural language hierachy, it is the code analogy of flow chart, and is the first step past flow diagrams, like so:

    IF FRONT_BUMPER_HIT OR BACK_BUMPER_HIT THEN REVERSE_MOTOR_DIRECTION ENDIF

    Other than the flow control language used, it bears no resemblance to a specific language, and actions taken are descriptive rather than directive (ie the exact means for performing the action is not provided). In a large company the pseudo code is provided to a various teams of software engineers to fill in the details, along with the interface (data structures, procedure arguments and returns) between sections worked on by different teams.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
  • Pezi_Pink!Pezi_Pink! Posts: 32
    edited 2006-04-28 15:22
    Yes, it is true.

    Generally with pseudo code the author will write it vaguely resembling the language they are using (assuming it's a high level language), but there is no standard.· I suppose it depends what you are expressing and how complex it is.

    When I write pesudo code however, I tend to forget about the language and just use it purely to describe basic program steps and operation.· Conditionals and loops are still the same in concept reagrdless of language so I usually express anything from asm to c++ with simple steps.· If you need to describe a more complex program which is using a class heirachy or something then I certainly wouldn't use pseudo code for this.

    Personally if it's going to get pretty complicated I'd rather plan it out another way than pseudo code.· I just use this for a simple literal flowchart that resembles basic program structure/flow if you will.

    So yeah, its a simple way of throwing a basic program flow sketch out, do it however you like as long as it makes sense [noparse]:)[/noparse]

    Pezi

    ·
  • Pezi_Pink!Pezi_Pink! Posts: 32
    edited 2006-04-28 15:24
    Paul,

    I didn't realsie there was ANY official standard, only what a company would define for their workers!

    Learn something new everyday.

    Pezi
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-04-28 15:36
    Its not standardized in the true sense, like through ANSI or something. Im not even sure if many companies follow the practice any more, I got the impression that it used to be that way, before the widespread adoption of C. The first year of my college textbooks use psuedocode (unless they cover a specific language such as LISP), but afterwards my·books switched to providing examples in C, this may be due to the increased knowledge level of the coursework, and thier expectation of you having learned C in the interm (perhaps the earlier books sought to seperate learning the language from proper programming methods). The only high level course book I have which uses psuedo code is "Introduction to Software Engineering, Principles and Practice", where it is provided as an intermediate language before being fleshed out into C.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    1+1=10
Sign In or Register to comment.