Google

Thursday, July 12, 2007

Introduction to Programming




The commands in a program are pretty useless unless they have some data to act on so programmers either give the programs some data to work with (list of names or numbers for example) or they make the program generate it’s own data. Sometimes, the data comes from an outside source like the Internet or the computer that the program runs on. The data that a program receives is called input and data that the program generates is called output.


Other times, the data is unknown. If the program were working with a simple algebra equation like, “x + 5 = y,” the variables “x” and “y” would be unknown pieces of data. Or if a program were to calculate a date “x” days from now, the variable “x” would be an unknown piece of data until we tell the program what “x” is. In programming, it’s sometimes required to work with unknown pieces of data.


That’s when conditions come in handy. Conditions allow a program to perform an action based on the outcome of a previous command.3 Using this type of instruction, we could instruct a program to do one thing if the “x” variable in our latter example turned out to be 7 days, and then do different thing if the variable turned out to be 3 days.


Commands, data, variables, and conditions help build the most simple programs and there are certainly many more components of any programming language. But when they’re typed into a programming language and compiled to create a an executable file (a file ending with the .exe extension), they turn into a software application.


As we mentioned earlier, you can use a programming language to control your computer. By using simple commands, you can program your computer to perform mathematical tasks, fill out web forms, compose an email message and send it off, or any number of other things. If you’re interested, you may find Visual Basic is one of the most easiest programming languages to learn. Visual Basic is an object-oriented programming language and it automatically codes much of a program the minute a programmer drags a button onto a screen.