Computer Programs and Programming Languages

Although you may never write a computer
program, information you request may require
a programmer to create or modify a program.
Thus, you should understand how programmers
develop programs to meet information requirements.
A computer program is a series of instructions
that directs a computer to perform tasks. A
computer programmer, often called a developer,
creates and modifies computer programs.
To create a program, programmers sometimes
write, or code, a program’s instructions using a programming
language. A programming language
is a set of words, abbreviations, and symbols that
enables a programmer to communicate instructions
to a computer. Other times, programmers
use a program development tool to create a program.
A program that provides a user-friendly
environment for building programs often is
called a program development tool. Just as humans
speak a variety of languages (English, Spanish,
French, and so on), programmers use a variety
of programming languages and tools to create
programs (Figure 13-1).
Several hundred programming languages exist
today. Each language has its own rules for writing
the instructions. Languages often are designed for
specific purposes, such as scientific applications,
business solutions, or Web page development.
When solving a problem or building a solution,
programmers often use more than one language;
that is, they integrate the languages.
Two types of languages are low-level and
high-level. A low-level language is a programming
language that is machine dependent. A machinedependent
language runs on only one particular
type of computer. These programs are not easily
portable to other types of computers. Each
language instruction in a low-level language
usually equates to a single machine instruction,
discussed further in the next section. With a
high-level language, by contrast, each language
instruction typically equates to multiple machine
instructions. High-level languages often are
machine independent. A machine-independent
language can run on many different types of
computers and operating systems.
The following pages discuss low-level languages,
as well as several types of high-level languages.

Low-Level Languages

Two types of low-level languages are machine
languages and assembly languages. Machine
language, known as the first generation of
programming languages, is the only language
the computer directly recognizes (Figure 13-2).
Machine language instructions use a series of
binary digits (1s and 0s) or a combination
of numbers and letters that represents binary
digits. The binary digits correspond to the
on and off electrical states. As you might
imagine, coding in machine language is tedious
and time-consuming.
With an assembly language, the second
generation of programming languages, a programmer
instruction codes (Figure 13-3). Symbolic
instruction codes are meaningful abbreviations.
With an assembly language, a programmer
writes abbreviations such as A for addition, C
for compare, L for load, and M for multiply.
Assembly languages also use symbolic
addresses. A symbolic address is a meaningful
name that identifies a storage location. For
example, a programmer can use the name
RATE to refer to the storage location that
contains a pay rate.
Despite these advantages, assembly languages
can be difficult to learn. In addition, programmers
must convert an assembly language
program into machine language before the
computer can execute, or run, the program. That
is, the computer cannot execute the assembly
source program. A source program is the
program that contains the language instructions,
or code, to be converted to machine language.
To convert the assembly language source program
into machine language, programmers use
a program called an assembler.
One assembly language instruction usually
equates to one machine language instruction.
In some cases, however, the assembly language
includes macros. An assembly language macro
generates many machine language instructions
for a single assembly language instruction.
Macros save the programmer time during
program development.
Today, assembly languages primarily are used
to increase the performance of critical tasks or
to control hardware
writes instructions using symbolic

Procedural Languages


The disadvantages of machine and assembly
(low-level) languages led to the development
of procedural languages in the late 1950s and
1960s. In a procedural language, the programmer
writes instructions that tell the computer
what to accomplish and how to do it.
With a procedural language, often called
a third-generation language (3GL), a programmer
uses a series of English-like words to
write instructions. For example, ADD stands
for addition or PRINT means to print. Many
3GLs also use arithmetic operators such as *
for multiplication and 1 for addition. These
English-like words and arithmetic symbols
simplify the program development process for
the programmer.
As with an assembly language program, the
3GL code (instructions) is called the source
program. Programmers must convert this source
program into machine language before the computer
can execute the program. This translation
process often is very complex, because one 3GL
source program instruction translates into many
machine language instructions. For 3GLs, programmers
typically use either a compiler or an
interpreter to perform the translation.
A compiler is a separate program that converts
the entire source program into machine
language before executing it. The machine language
version that results from compiling the
3GL is called the object code or object program.
The compiler stores the object code on storage
media for execution later.
While it is compiling the source program
into object code, the compiler checks the source
program for errors. The compiler then produces
a program listing that contains the source code
and a list of any errors. This listing helps the
programmer make necessary changes to the
source code and correct errors in the program.
Figure 13-4 shows the process of compiling a
source program.
A compiler translates an entire program
before executing it. An interpreter, by contrast,
translates and executes one statement at a time.
An interpreter reads a code statement, converts
it to one or more machine language instructions,
and then executes those machine language
instructions. It does this all before moving to the
next code statement in the program. Each time
the source program runs, the interpreter translates
and executes it, statement by statement. An
interpreter does not produce an object program.
Figure 13-5 shows the process of interpreting a
program.
One advantage of an interpreter is that
when it finds errors, it displays feedback
immediately. The programmer can correct
any errors before the interpreter translates
the next line of code. The disadvantage is
that interpreted programs do not run as fast
as compiled programs. This is because an
interpreter must translate the source program
to machine language each time the program
executes. Once a program is compiled, by
contrast, users simply execute the object code
to run the program.
Many programming languages include both
an interpreter and a compiler. In this case, the
programmer can use the interpreter during
program development. When the program
is complete and error free, the programmer
can compile the program so that it runs faster
when it is placed into production for users to
execute.
Hundreds of procedural languages exist. Only
a few, however, are used widely enough for the
industry to recognize them as standards. These
include C and COBOL. To illustrate the similarities
and differences among these programming
languages, the following figures show
program code in these languages. The code
solves a simple payroll problem — computing
the gross pay for an employee.
The process used to compute gross pay can
vary from one system to another. The examples
on the following pages use a simple algorithm,
or set of steps, to help you easily compare one
programming language with another. Read
Innovative Computing 13-1 to find out about
some useful and fun online programs.

C

The C programming language, developed
in the early 1970s by Dennis Ritchie at Bell
Laboratories, originally was designed for writing
system software. Today, many programs are
written in C (Figure 13-6). This includes operating
systems and application software such as
word processing and spreadsheet programs.
C is a powerful language that requires professional
programming skills. Many programmers
use C for business and scientific problems. C
runs on almost any type of computer with any
operating system, but it is used most often with
the UNIX and Linux operating systems

COBOL

COBOL (COmmon Business-Oriented
Language) evolved out of a joint effort
between the United States government,
businesses, and major universities in the
early 1960s (Figure 13-7). Naval officer
Grace Hopper, a pioneer in computer
programming, was a prime developer of
COBOL.

COBOL is a programming language
designed for business applications. Although
COBOL programs often are lengthy, their
English-like statements make the code easy
to read, write, and maintain. COBOL especially
is useful for processing transactions,
such as payroll and billing, on mainframe
computers. COBOL programs also run on
other types of computers.

NEXT LANGUAGE ARTICLE WILL BE PUBLISH SOON ABOUT OTHER LANGUAGE.

SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

2 comments:

  1. We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends. 온라인 영어

    ReplyDelete
  2. Bet365 Casino - Mapyro
    Bet365 is a global 광주광역 출장샵 leader in online 사천 출장샵 gambling and casino gaming. The 경상남도 출장샵 company provides casino games to the world's leading operators, with hundreds of  Rating: titanium tubing 4.3 · 김천 출장샵 ‎4 votes

    ReplyDelete