VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 20

Understanding Early Pseudocode

Even though programmers commonly refer to the code produced by VB as pseudocode, this term actually has another meaning that predates VB.

Pseudocode is a technique for expressing the operations of a computer program or an algorithm in a natural language, such as English. It was developed as an alternative to flowcharting.

A pseudocode representation of a program generally retains the flow control directives of the computer language actually being used to develop the program, but it replaces the rest of the program with high-level, natural language descriptions of the processes.

Because Visual Basic flow control uses reserved words such as DO, LOOP, WHILE, IF, and so on, here’s the pseudocode for a program to read a book:

open book to first page
read page
turn to next page
UNTIL end of book

The implementation details of reading a page and turning pages are not provided, but there is enough information to determine whether any tasks are omitted or out of sequence. It is easy to see that the read page step needs to occur before the turn page step.

If these were reversed, the first page of the book would never be read. This is called pseudocode because it looks sort of like programming code, but it really isn’t (the prefix pseudo comes from the Greek word for false). This kind of pseudocode is much different from Visual Basic P-Code, which bears some resemblance to native machine code, but isn’t fully translated.

In any case, the term is commonly used to refer to the pseudo– machine-code produced by VB, so you are stuck with it., If you talk to other programmers who don’t work with VB, you may find that their notion of pseudocode differs from yours.


<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved