- Learning to Program—The stages of programming
- Learning to Program – Some Terms You Should Understand
- Learning to Program – IPO Charts (Stage 1)
- Learn to Program- Flowcharting (Stage 2)
- Learning to Program – Flowcharting (Stage 2). — Decisions and Loops
- Learning to Program—Flowcharting (Stage 2) – Case Statements
- Learning to Program (Stage 2)—Flowcharting – Methods and Classes
- Learning to Program – Structure and Spaghetti Code
- Learning to Program – Pseudocode (Stage 3) an overview
- Learning to Program – Stage 3 Pseudocode commands and reserved words
- Learning to Program—Stage 3 Pseudocode examples Part 1
- Learning to Program – Stage 3 Psuedocode (Arrays)
- Learning to Program – Stage 3: Pseudocode—Methods
- Learning To Program—Stage 3.5 (UML Diagrams)
- Learning to Program – (Stage 4) Coding
- Learning To Program—Stage 5 Testing
- Learning to Program—Stage 6 (Documentation)
- Learning to Program – Stage 7 (Maintenance)
- Learning to Program—Random Thoughts with a Theme
- Learning to Program- Two Main Types of Errors
- Learning to Program – Integrated Development Environments (IDE’s)
- Learning to Program
Ok, I decided that I should clarify some terms that you need to understand if you are going to write programs. Most of these apply to pseudocode and the actual source code, but some apply to flowcharting as well. If the term is specific to one stage, I will put that as well.
First I’ll start with a couple of Acronyms. Some of these should be familiar to you, while others may not.
RAM– Random Access Memory. This is the memory that your computer uses to do everything. It’s considered volatile because as soon as the power goes off, the memory is lost. That’s why you’re encouraged to save everything (papers, files, source code) on a regular basis.
ROM– Read Only Memory. This is the memory typically found in firmware. It’s written once, and permanent. Technically, it can be overwritten (or flashed), but for all intensive purposes it’s permanent.
WYSIWYG- “What You See Is What You Get”. This is meant to imply that however you design something, that’s how the user should see it. So, design with the user in mind.
GIGO- Garbage In, Garbage Out. What this means is, if you don’t know what is in the memory location that you’re using, you won’t know what the results will be after using the information there. In other words, ALWAYS INITIALIZE YOUR VARIABLES.
LIFO– Last In First Out. If you’re using nested if statements, or a combination of blocks which are nested inside of each other, the last one you create is the first one that ends. This is typically used in Pseudocode, but does have applications in source code as well.
An example of LIFO is this:
While not EOF
If dog = “fido” then
print “Hi Fido”
Note the endif was the first “exit” since the if was the last entrance.
Now some terms that you’ll see me throw out in these lessons:
variable– A variable is a name that you give to a pointer, which points to a location in RAM. The location is going to store any information that you put in it (assigning a value to a variable). Think of it like a bowl.
constant– A constant is a type of variable where you assign the value when you declare it, and it cannot be changed. An example of this is an Interest Rate.
The theory behind constants is this. If you use the same information in 50 different places in the program, and need to change it, which is easier? Change in one spot (the constant) or look for 50 of the values?
array- An array is another special type of variable. The concept of an array is this. If you have multiple copies of a variable, you can declare an array and list the number of copies—as opposed to creating each one individually.
The example that I used is this. If you are a cashier, and someone walks up with 20 bottles of Pepsi, which is easier: scan each bottle, or scan one bottle and type in 20? Either way, the same thing happens. You’ve created 20 spaces in memory with the same name (and something to differentiate them). Like the bottles, you can pick one bottle and do something with it—and in your program, you can pick one point in the array and work with it.
declaration– Declaration or declaring is the creation of the variables. You’re telling the compiler that you want to create a pointer in memory with the variable name. You’re also telling the compiler how much space in memory the variable will use (by it’s data type) and giving it an initial value (initializing the variable).
data type- This is how you tell the compiler how much memory the variable will need. In pseudocode there are four main types. They are:
char– (Character) which is one single character. This can be a single letter, number, space, or symbol.
String– This is two or more characters. They can be anything also.
num– (numeric) this is strictly a number. It can be an integer or a decimal number.
boolean– True or False.
In coding, the types vary. Some common types are:
char– Character (see above)
String– Same as above
int (or integer)– This is a whole number between the numbers –32,766 and 32,767.
long– This is a longer integer. The range is a lot higher than the int range.
float– In some languages, this denotes a decimal number.
real– In some languages this denotes a decimal number.
double– This is the manner in which decimals are denoted in Java, C++ and other languages.
method/class/procedure– This is a subroutine in a program. It can be looked at like this. If you have to do a certain sequence of lines repeatedly, you can put them into a method, and call that instead of typing them over and over.
A class is a method that can be used by more than one program. An example of this is a dll file in Windows, or a lib file in Linux (library).
A procedure is just another name for these (Pascal typically uses Procedures).
These are the bulk of the terms that you need to understand to get started. As you learn more about logic and programming, you will learn more.
Next time, I will dive into structured programming, and avoiding spaghetti code.
Have a great day:)