Thread: pseudo-code

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    7

    pseudo-code

    Does anyone know what is meant by 'High-level pseudo-code'?

  2. #2
    Registered User
    Join Date
    May 2007
    Posts
    147
    pseudo, as in false or fake

    high level, as in don't descend into the details.

    It means that want you to (somewhat freely) express the plan or outline of an algorithm without regard to a specific language. I don't recall there being in particularly strict rules in the depiction of pseudo code, though certainly someone could theoretically contrive some.

    For example:

    Code:
     For Each:
       { 
         Do Step A;
         Do Step B;
       }
    Might qualify as pseudo code. It's decidedly C looking with respect to ; and {.

    I've seen pseudo code that looks more like BASIC:

    Code:
      For Each:
    
           if Step A then Step B
           else Step C
    
      Next
    No one would expect pseudo code to drop into any compiler or language and make sense for actual use, but it should be descriptive of a plan such that code could be developed from it with simple translation.

    In "high level" you wouldn't see the specifics of managing memory (no mallocs or callocs), probably not even "new" or "delete".

    I don't use it much, and haven't since my college days a long, long time ago, so the notion may be different today.

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    7
    Okay. it because we are told to write a high level pseudo-code for the program we wrote. Iwas just not sure what they meant by 'high-level'.
    Thanks for your help

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    To be honest, I am more curious about what is "low level pseudo code"
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by laserlight View Post
    To be honest, I am more curious about what is "low level pseudo code"
    Hmm maybe something like:

    Code:
    eax <- 123
    ecx <- eax AND ecx
    if zero ecx goto dosomething
    (Note: just a joke. Don't take this post seriously. Please)

  6. #6
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312
    we are told to write a high level pseudo-code for the program we wrote.
    Any program is a pseudocode for itself.

    "High-level" probably means adding a meaningful comment to each non-trivial line of code and then remove the corresponding code.

    Greets,
    Philip
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  7. #7
    Registered User
    Join Date
    Apr 2009
    Posts
    187
    i thought it depends on the programming lang u use like if you use asm its low level and vb high level ?

  8. #8
    Registered User
    Join Date
    May 2007
    Posts
    147
    ...and I though pseudo code was supposed to be independent of language, more expressive of a plan for deployment in any language.

    Then, too, I've not used it much or seen it enough to know that for certain.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Proposal: Code colouring
    By Perspective in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 05-14-2007, 07:23 AM
  2. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 10:20 AM
  3. Explain this C code in english
    By soadlink in forum C Programming
    Replies: 16
    Last Post: 08-31-2006, 12:48 AM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM