0% found this document useful (0 votes)
52 views11 pages

Programming Languages: Foundations of Computer Science à Cengage Learning

Computer languages have evolved from machine language to high-level languages. Machine language used streams of 0s and 1s and was the only language understood by computers. Assembly languages replaced binary code with symbols, improving efficiency. However, programmers still had to focus on the hardware. This led to the development of high-level languages, which improved programmer efficiency and allowed focusing on solving problems instead of the computer. Programs are now written in high-level languages and translated into machine language through compilation or interpretation in order to run on computers. Computer languages are categorized based on their programming paradigm, such as procedural, object-oriented, functional, or declarative. Procedural languages share common concepts like identifiers, data types, variables, literals,

Uploaded by

Mustafa Adil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views11 pages

Programming Languages: Foundations of Computer Science à Cengage Learning

Computer languages have evolved from machine language to high-level languages. Machine language used streams of 0s and 1s and was the only language understood by computers. Assembly languages replaced binary code with symbols, improving efficiency. However, programmers still had to focus on the hardware. This led to the development of high-level languages, which improved programmer efficiency and allowed focusing on solving problems instead of the computer. Programs are now written in high-level languages and translated into machine language through compilation or interpretation in order to run on computers. Computer languages are categorized based on their programming paradigm, such as procedural, object-oriented, functional, or declarative. Procedural languages share common concepts like identifiers, data types, variables, literals,

Uploaded by

Mustafa Adil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Chapter 8

Programming
Languages
Foundations of Computer Science ã Cengage Learning 1
EVOLUTION
To write a program for a computer, we must use a computer
language. A computer language is a set of predefined words that
are combined into a program according to predefined rules
(syntax). Over the years, computer languages have evolved from
machine language to high-level languages.

 machine language
In the earliest days of computers, the only programming languages
available were machine languages. Each computer had its own
machine language, which was made of streams of 0s and 1s.
Note : The only language understood by a computer is machine
language. 2
 Assembly languages

The next evolution in programming came with the idea of

replacing binary code for instruction and addresses with symbols

or mnemonics. Because they used symbols, these languages were

first known as symbolic languages. The set of these mnemonic

languages were later referred to as assembly languages.

3
High-level languages
Although assembly languages greatly improved programming
efficiency, they still required programmers to concentrate on the
hardware they were using. Working with symbolic languages was
also very tedious, because each machine instruction had to be
individually coded. The desire to improve programmer efficiency
and to change the focus from the computer to the problem being
solved led to the development of high-level languages.
Over the years, various languages, most notably BASIC,
COBOL, Pascal, Ada, C, C++ and Java, were developed.
4
TRANSLATION
Programs today are normally written in one of the high-level
languages. To run the program on a computer, the program
needs to be translated into the machine language of the
computer on which it will run. The program in a high-level
language is called the source program. The translated
program in machine language is called the object program.
Two methods are used for translation:
1. Compilation : A compiler normally translates the whole
source program into the object program.
2. Interpretation : Interpretation refers to the process of
translating each line of the source program into the
corresponding line of the object program and executing
the line. 5
PROGRAMMING PARADIGMS
Today, computer languages are categorized according to
the approach they use to solve a problem. A paradigm,
therefore, is a way in which a computer language looks at
the problem to be solved. We divide computer languages
into four paradigms:
1. Procedural.
2. object-oriented.
3. functional.
4. declarative.
6
7
COMMON CONCEPTS
In this section we conduct a quick navigation through some
procedural languages to find common concepts.
1. Identifiers: it is the name of objects.
2. Data types : defines a set of values and a set of
operations that can be applied to those values.
3. Variables : are names for memory locations.
4. Literal : is a predetermined value used in a program(π).
5. Constant, like a variable, is a named location that can
store a value, but the value cannot be changed after it
has been defined at the beginning of the program
6. Inputs and Outputs
7. Expressions ; is a sequence of operands and operators
that reduces to a single value.
8. Statements.
9. Subprograms. 8
Structured programming strongly recommends the use of the
three types of control statements: sequence, selection and
repetition

Two-way and multi-way decisions


9
Three types of repetition
10
Subprograms
The idea of subprograms is crucial in procedural languages
and to a lesser extent in object-oriented languages. This is
useful because the subprogram makes programming more
structural: a subprogram to accomplish a specific task can be
written once but called many times, just like predefined
procedures in the programming language.

The concept of a subprogram


11

You might also like