The purpose of this article is to introduce you to the world of Pseudo Code and help you improve your development skills.
Submitted On | |
By | D Davis |
Level | Beginner |
User Rating | 4.9 (49 globes from 10 users) |
Compatibility | VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0, VB Script, ASP (Active Server Pages) , VBA MS Access, VBA MS Excel |
Category | Coding Standards |
World | Visual Basic |
Archive File |
Making Life Easier
with Pseudo Code By: Dustin Davis (Programmers-Unlimited.com) |
Introduction |
Pseudo Code is not
a programming language in specific, but it is a language specific to your
native tongue (English, Spanish, etc.). It is a type of "modeling"
tool that will be a great friend to you in future projects. By using non
code specific terms and phrases, applications written in Pseudo Code can
easily be understood by multiple developers, and if written well enough,
can be used to translate applications to different platforms and programming
languages. This means a great deal to anyone who has experience in developing
on a tight time table. In basic terms, Pseudo Code is the english (or whatever) version of real code. Let's take a look at some Pseudo Code. |
Getting Started | |
Getting started is the hard part as it requires that you have an idea that has been thought out. A word of advice is that you should never wait until you have 100% of your project worked out. If you do, you will most likely never start. For this article, we will design a simple program to emulate a Pay Phone. The first step we
need to take is designing and overall general program flow. A Pay Phone
is pretty easy to do as it does not have much to it.
Pretty simple eh?
Like I said, not much to a Pay Phone. So now we have an overall general
view of what we need to do, let's get moving with the next step. |
Breaking Down the Overall Process | |||
The next thing to do
is go back over the overall general view that we created. We will take each
step and break it down into working Pseudo Code. "Wait for user" This process could contain anything depending on the phone. Most phones are just dead, but some of the newer phone have LCD's that display all sorts of things. In this example, let's just make it simple
On the first line, we define a function. Anyone who reads this will be able to tell that the following will be inside of the "Wait for user" function. On the following line, you will see "Get Time". This tells the reader that the code for getting the time will go in that spot, before "Display Time On LCD". We continue writing the parts of the function that it will contain. Notice that it's easy to read compared to code? This is the power of Pseudo Code. Using Pseudo Code, we have just created a template for our "Wait for user" function. This template will allow anyone to come back to it and fill it in with code of their choice. "Take money"
, "Take input"
These functions are pretty simple and are no different from our "Wait for user" function. These functions are simply templates for later code insertion. "Make call"
I just want to clarify that I am no phone technician and I know that there are many many more operations to a Pay Phone, but this is what we have for this article. Let's move on to the next section. |
Further Breakdown | |
Now that you understand that Pseudo Code is crazy simple, let's get into some specifics. We will go back to our "Wait for user" function. We are going to modify it so that when you assign it to your programmer, he will understand exactly what you want.
You think I'm a crazy person who's toying with you now, don't ya?! I'm serious, this is how easy Pseudo Code can be. You can modify your Pseudo code to look as you like, just keep in mind the readability for others (if any at all). |
Conclusion |
The power of Pseudo
Code can be from 0 to unlimited. It all depends on you and your methods.
Pseudo Code can scale the ease of transition from Pseudo Code to Real
Code depending on how you use it. If you use more programming language
specific articles, you will have an easier time porting it into real code.
In most cases, Pseudo Code can be directly replaced with code with little
to no extra thinking. |