Credit: Microsoft Clipart

## 5 Easy Steps to learn how to do computer programming!

Computer programming can be incredibly easy. Have you ever written a macro in Microsoft Excel or changed the time zone on your PC? If so you’ve already written a very basic computer program! Of course, computer programming can also be – literally – rocket science. Doctoral students study for years and years to learn this level of complex programming.

So how can you jump right in and get started?

1. Decide your computer programming goals.

In other words, why do you actually want to learn computer programming in the first place? Only you know for sure, but examples include:

• Accomplishing a specific task on the computer
• Looking for a career change
• Creating a website for personal or business use
• Solving a problem

Once you have clearly defined your computer programming goals, you can jump right in.

2. Write your first program – on paper

Wait just a second. Am I skipping a few steps here? Actually, no. The best way to learn how to do computer programming is to jump right in. Start on paper, and then we will transfer that to the computer.

• Think simple. In one sentence, what will your program do? Write this down.
• Now decide whether this will be accomplished online (in a web browser), within an existing program (like Microsoft Excel), or as a stand-alone program on your desktop.
• Finally, understand that computers are much like a very simple human brain. In order to do computer programming, you need to think through each interaction and carefully define it as if it were a conversation. Again, write this conversation down.

Let’s use a real-world example. I want to create a program that allows me to guess a number between 1-100 and then tells me if I got it right or if I need to guess higher or lower.  I want to do this online. Here’s what my “conversation” would look like:

Computer should choose a number at random between 1-100.

Computer should ask me to guess the number.

Computer should give me a place to input my guess.

Computer should compare my guess to the random number.

If my guess is too high, computer should tell me “Too High” and give me a place to guess again.

If my guess is too low, computer should tell me “Too Low” and give me a place to guess again.

If my guess is anything but a number between 1-100, computer should tell me “Out of range, must be between 1-100” and give me a place to guess again.

If my guess is correct, computer should tell me “You Win!” and then start the game over.

3. Translate your program to pseudo-code

We’re going to continue to work on paper. When you are programming the computer, the language you use is referred to as “code”. Before writing real code that the computer can understand, when learning how to do computer programming it helps to write in pseudo-code. Here’s how:

First, analyze the program you wrote on paper. Look for the following key components: Inputs, Outputs, Functions, Variables, and If/Then statements.

Input: Any time you give the computer information

Output: Any time the computer gives you information

Function: When the computer does something internally with your input to create new output or change a variable.

Variable: Simply a placeholder that the computer uses to store a value.

If/Then Statements: These are a form of rules that control process flow.

Say what? Again, let’s use our above example:

Function: Choose a random number

Variable: Store this random number as a variable, r

Input: You choose a number

Variable: Store your number as a variable, n

Function: Compare n to r

If/Then: If n > r, Then

Output: Too high, guess again

If/Then: If n < r, Then

Output: Too low, guess again

And so on.

4. Write real computer code

Now it’s time to program your computer. Your best bet is to search online for people who have written similar programs to you and who are willing to share their code. Do a search for “ [my program description] programming tutorial beginners”. In this case, we’d search for “random number game programming tutorial beginners”.

Now read through the tutorials you find and take careful notes of the tools that they are using and the syntax of their language. Read line to line and try to match your lines with theirs.

Finally, open up your tool of choice (learned from the tutorial), and get to work! Keep testing to see if the computer is doing what you want it to each step of the way, and if it’s not, “de-bug” or try to figure out why. When you get stumped, just ask for help on one of the many programming forums that exist.

5. Repeat the entire process!

The more you program the better you will get at it. Remember, you can’t learn by reading alone – you need to actually do computer programming to get better. Keep following this process with more and more complex programs, but always start as simple as possible.

Good luck, and have fun.