Tuesday, August 11, 2009

What is Programming? Part I

Computer Programs are made up of a series of instructions that the computer executes to perform some desired task. The process of defining these instructions that the computer will execute is called programming. You normally store the instructions in a standard text file (ASCII file), also known as the source code, which is then either interpreted by a program called, appropriately enough, an interpreter into "machine language" (the binary codes a computer actually executes) or is compiled by a program...guess what, it's called a compiler. Interpreted code typically is executed instruction by instruction immediately by the computer. Compiled code is saved to a file in its binary format for later execution.

Compiled code, also known as object code, is then run through another program called a Linker to link it to any "libraries" of code the program referenced. Once a compiled program has been linked it is known as an executable and will often have a three letter extension of .EXE or .COM.

Keep in mind that programmers, not being stupid, don't want to re-invent the wheel every time they write a program, so they have created many, many, libraries of code over the last 50 plus years. Today almost all programs will link into code already written by those that have come before. Today's programs are often "frameworks" that provide calls to code in many of those libraries .

When we talk about a computer language we are generally talking about an English-like language that uses words and syntax to make up statements that we, humans, can easily read and understand. These English-like languages are called higher level computer languages. Higher level languages like Ada, BASIC, C, C++, C#, CoBOL, FORTRAN, Java, and Pascal...to name just a few...are how most programs are written today. The various languages have their own strengths and weaknesses, just as a carpenter won't try to use a single tool for every job, a programmer won't use a single language for every program. You should learn several!

There are also low level computer languages, called assemblers, that are much harder for us to read and understand. Assemblers typically allow a programmer to more finely detail exactly what they want a computer to do, so are used mostly to "tweak" programs rather than to write entire programs. Today, few programmers learn assembler, or for that matter how to work directly with machine code, however, if you plan to make a career of programming, you might want to consider learning how to work with these lower level languages.

No comments:

Post a Comment