Programming a computer

Programming involves the preparation and writing of detailed instructions for a computer. These instructions tell the computer exactly what data to use and what sequence of operations to perform with the data. Without programs, a computer could not solve problems or deliver any other desired result.

Some people prepare their own computer programs. But in many cases, computer scientists and other computer specialists called programmers write instructions for computers. They use programming languages that consist of letters, words, and symbols, as well as rules for combining those elements.

A computer cannot work directly with a program written in a programming language. The instructions must be translated into a machine language composed of binary digits. These digits represent operation codes, memory addresses, and various symbols, such as plus and minus signs. Machine language is also known as low-level language.

Special programs called compilers and assemblers translate programming languages into machine language. Another special type of program called an operating system contains instructions for the operation of a computer. It controls the input and output devices, and it reads and responds to user commands. It also places programs and data into the memory and makes sure that the processor executes the right programs. Thus, the operating system combines the many separate parts of a computer into a single useful system.

Compilers, assemblers, and operating systems may be viewed as "smart (intelligent) programs" because they enable a computer to understand complicated instructions. The user communicates with the smart program, and the smart program communicates with the computer. A computer combined with a smart program acts like a different, smarter computer. This combination is called a virtual machine.

Preparing a program begins with a complete description of the job that the computer is to perform. This job description is obtained from the person for whom the program is being prepared, such as a business manager or an engineer. It explains what input data are needed, what computing must be done, and what the output should be. Computer programmers use the description to prepare diagrams and other pictorial aids that represent the steps needed to complete the task. The programmers may produce a diagram called a systems flow chart that shows how all the major parts of the job fit together systematically.

After a computer program is written, it is tested on the computer for mistakes. Computer experts refer to mistakes in programs as "bugs" and the testing of programs as "debugging."

A program generally is entered into a computer in what is known as an interactive environment. In such an environment, the programmer enters part of the program on a computer terminal. The computer's operating system responds immediately, telling the programmer how the computer will interpret each instruction. The programmer then can analyse each response. Programs that result from this interaction between the programmer and the computer generally are stored on some type of file storage device until needed.

Using programming languages. Computers appear to work directly with programming languages. But the smart program, not the computer, actually understands these languages. The smart program translates a program into machine language. It then enters the translated version into the computer's memory. The processor reads and executes each translated instruction.

There are many different high-level programming languages. Some of them closely resemble the language of mathematics. Others enable programmers to use symbols and various everyday expressions, such as "READ," "PRINT," and "STOP." All high-level languages are designed to let the programmer concentrate on the basic ideas of a task rather than on the details.

The language that a programmer uses depends largely on the job to be done. If a task involves processing business data, the programmer would most likely use COBOL (COmmon Business Oriented Language). However, programming a computer to solve complicated scientific problems might require the use of a mathematically oriented language, such as FORTRAN (FORmula TRANslation).

Some high-level languages can be used for business, technical, or scientific programming. Such languages include APL (A Programming Language); C; and LISP (LISt Processor).

Another commonly used programming language is BASIC (Beginner's All-purpose Symbolic Instruction Code). BASIC is well suited for writing relatively simple programs for personal computers. Many primary schools and secondary schools that offer a course in programming teach BASIC because it is easy to learn and to use. Pascal, named after the French mathematician and scientist Blaise Pascal, also is taught in a large number of schools.

Some computer programs may be written in an assembly language. This kind of language is harder to use than a high-level language. The programmer must state each instruction very precisely, with much more detail than is needed when using a high-level language.

Computer Industry (Next)

 

History of computers | Importance of computers | Basic Principles | Kinds of computers | How Computer Works | Programming a computer | Computer Industry | Development of computers | Problems of computer age|

 

Main Page | Products | Services | Entertainment | History | Contact Us