Posted by Ganon11
So, you want to learn how to program! Good for you! Programming is a very intruiging and fun activity to pick up, and it's also a great career choice if you like it! Finally, it can be a great brain teaser-type activity, as you challenge yourself with creative and difficult problems!
But there's a problem.
What I'm typing in right now is English. It's cool, it lets you understand what I'm saying, and we've spoken English all our lives. What I'm GOING to be writing in, however, could be called another language entirely. It's what I (rather uncreatively) call Computer-Talk. You would have no trouble understanding the sentence, "Today I took a walk in the park." But try your hand at understanding, "Access the value at position i of myArray to initialize your variable."
Huh?
Fortunately, we won't be dealing with anything this weird for a while. Until then, I'm going to be teaching you a little bit about the basics of Computer-Talk - easy things that you may have heard of before, like Variables, or Input. I'm also going to show you a few things that we see in English class or Math class, but mean completely different things when programming. So let's get started!
The very first vocabulary words we have to learn about are the basics of any language. You have to know what I'm talking about when I ask you to write some programs. Writing programs is called coding, since we are writing code that the computer will be able to understand. Once we finish our beautiful programs, we have to turn them into something the computer can understand. In order to do this, we use a compiler. A compiler can also be a program that helps you to code. For example, I use Bloodshed Dev C++. Not only does this let me compile and run my programs, but it will recognize certain keywords and highlight, change color, or embold them so that I can see important things more easily. This type of compiler is called an Integrated Design Environment, or IDE, because it is an environment that is friendly to us while we design our program. Cool, yeah?
All right, down to some hardcore programming terms. The most important thing to learn for a beginner is input and output. When you ask the user (that's whoever will be running your finished program) for some value that will change the way your program runs, that's called input. In other words, the user is inputting a value. For example, suppose you made a guessing game in which your program generates a random number and the user tries to guess it. Well, in order to do this, you need to be able to get the value, right? Right. That's input.
Output is even simpler. Any program you run has results. You click a button: something appears on the screen. You move: it plays a sound. The moniter and speakers are both output devices - they are a way for the computer to communicate with you. Our output will be very simple, consisting mainly of words appearing in a text box, but it is still vital. Output will help you to determine what your program does. For example, in the guessing game, your program needs to tell the user if they have guessed the number or not. It wouldn't be a very good program if you didn't let the user know if they won, would it? Output can also be used to determine where your program is NOT working (God forbid!). By placing output statements in critical points, you, the programmer, can say, "All right, I expected this value to be this, but instead it's this. This must have gone wrong," and so on.
The final word on our list of basics is syntax. In English, syntax means "the study of the patterns of formation of sentences and phrases from words." (http://dictionary.reference.com/browse/syntax) For example, I type in a very straightforward manner. But consider Yoda, who would say, "In a very straightforward manner type I." The difference in our speaking style is in syntax. Syntax has a similar meaning in programming. In order for the computer to understand what you type, you have to follow certain rules. These rules will become evident as we learn some real programming terms.
Well, now you know what I mean when I say, "Compile your program and tell me the output." You also know what I mean when I say, "Ask the user for input." But you still don't know any real programming! That will come next time, when I show you the most basic of all programs - Hello World!