Lec 19 Programming Languages
Lec 19 Programming Languages
Lecture
(Programming Languages)
1
Programming
• The process of telling the computer
what to do
Also known as coding
2
TYPES OF PROGRAMS
• Batch Program
• Event-Driven Program
BATCH PROGRAMS
These are typically started from a shell (or
automatically via a scheduler) and tend to
follow a pattern of:
– Initialize internal data
– Read input data
– Process that data
– Print or store results
7
ALL PROGRAMS CONSISTS OF:
1. Sequence of instructions
2. Conditionals
3. Loops
8
• Machine Language • Ada(1983)
• Assembly Language • C++ (1983-85)
(1956-63) • QBasic (1986)
• LISP (1956) • Perl (1987)
• Fortran (1957) • VisualBasic (1991)
• COBOL (1959) • PowerBuilder
• PL/1(1964) • Java (1995)
• BASIC (1964) • JavaScript
• Pascal (1970) • C# (2001)
• Smalltalk (1972)
• C (1972)
CLASSIFICATION OF PROGRAMMING
LANGUAGES
• Business Languages: COBOL having report writing
capabilities.
13
High-level programming languages, while
simple compared to human languages, are
more complex than the languages the uP
actually understands, called machine
languages
14
Lying between
machine languages
&
high-level languages
are languages called
assembly languages
15
Assembly languages are similar to machine languages, but are easier to program in as they allow a programmer to substitute names for numbers
An assembly language instruction has a mnemonic to describe the operation and allows the programmer to name memory location.
The assembly language instruction is converted into the machine code instruction by an assembler program.
16
4th-generation languages
High-level languages
Assembly languages
Machine languages
17
• PowerBuilder is 4th generation language.
19
Interpreter is a program that executes instructions written in a high-level language
An interpreter translates high-level instructions line by line into an intermediate form, which it then executes
20
Compiled programs generally run faster than interpreted programs
The advantage of an interpreter, however, is that it does not need to go through the compilation stage during which the whole of the high-level code
is translated into machine instructions in one go. This process can be time-consuming if the program is long.
The interpreter can immediately execute high-level programs, without waiting for the completion of the translation process
21
Interpreters:
Immediate response,
but
execute code slowly
Compilers:
Takes longer to compile,
but
super-fast execution 22
Both interpreters and compilers are available for most high-level languages.
23
CLASSIFICATION OF
PROGRAMMING LANGUAGES
Procedural Languages
Non-Procedural Languages
25
PROCEDURAL LANGUAGES
• In procedural languages and programs used to
tell the computer exactly what to do, step by
step.
28
FORTRAN is a particularly good language for
processing numerical data, but it does not lend
itself very well to large business programs
29
The choice of which language to use can also depend on the:
and the
30
FORTRAN
• FORTAN stands for FORmula TRANslation.
41
Array
An indexed list of elements
42
Array
An indexed list of elements
43
Array
fruit[0]
Square
Identifier Index
bracket
44
ABSTRACT DATA TYPES
• Abstract data types (ADTs) are complex data
types that have operations associated with them.