|
|
|
|
|
|
|
Early on, programmers worked with the most primitive computer instructions: machine language. These instructions were represented by long strings of ones and zeroes. Soon, assemblers were invented that could map machine instructions to human-readable and manageable mnemonics, such as ADD and MOV. |
|
|
|
|
|
|
|
|
New Term: In time, higher-level languages evolved, such as BASIC and COBOL. These languages let people work with something approximating words and sentences, such as Let I = 100. These instructions were translated back into machine language by interpreters and compilers. An interpreter, like BASIC, translates a program as it reads it, turning the programmer's program instructions or code directly into actions. |
|
|
|
|
|
|
|
|
New Term: New compilers translate the code into what is called object code. The first step in this transformation is called compiling. A compiler produces an object file. The second step is called linking. A linker transforms the object file into an executable program. An executable program is one that runs on your operating system. |
|
|
|
|
|
|
|
|
Because interpreters read the code as it is written and execute the code on the spot, they are easy for the programmer to work with. Compilers introduce the inconvenient extra steps of compiling and linking the code. On the other hand, compilers produce a program that is very fast each time it is run. |
|
|
|
|
|
|
|
|
For many years, the principal goal of computer programmers was to write short pieces of code that would execute quickly. The program needed to be small because memory was expensive, and it needed to be fast because processing power was also expensive. As computers have become smaller, cheaper, and faster, and as the cost of memory has fallen, these priorities have changed. Today the cost of a programmer's time far outweighs the cost of most of the computers in use by businesses. Well-written, easy-to-maintain code is at a premium. Easy-to-maintain means that as business requirements change, the program can be extended and enhanced without great expense. |
|
|
|
|
|
|
|
|
Procedural, Structured, and Object-Oriented Programming |
|
|
|
|
|
|
|
|
New Term: In procedural programming, programs are thought of as a series of actions performed on a set of data. Structured programming was invented to provide a systematic approach to organizing these procedures, and to managing large amounts of data. |
|
|
|
|
|
|
|
|
The principle idea behind structured programming is as simple as the idea of divide and conquer. Any task that is too complex to be described is broken down into a set of smaller component tasks, until the tasks are small and self-contained enough that they are easily understood. |
|
|
|
|
|