0% found this document useful (0 votes)
6 views6 pages

Summary 1

The first four chapters of 'Comparative Programming' introduce various development processes and programming languages, including imperative, procedural, functional, and logic languages. A historical survey covers the evolution of languages like FORTRAN, ALGOL, and PASCAL, highlighting their objectives and challenges. The chapters also discuss data types, expressions, and statements, emphasizing the importance of readability, scope, and exception handling in programming.

Uploaded by

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

Summary 1

The first four chapters of 'Comparative Programming' introduce various development processes and programming languages, including imperative, procedural, functional, and logic languages. A historical survey covers the evolution of languages like FORTRAN, ALGOL, and PASCAL, highlighting their objectives and challenges. The chapters also discuss data types, expressions, and statements, emphasizing the importance of readability, scope, and exception handling in programming.

Uploaded by

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

SUMMARY OF THE FIRST 4 CHAPTERS OF THE

BOOK “COMPARATIVE PROGRAMMING”.

CHAPTER 1: Introduction
1. Main objective :
 present different development processes
 present language designs and systems.
2. Key concepts
 presesntation of development models such as waterfall model ,
development approacges such as the incremental and iterative
approaches.
3. Language design
 imperative languages : A program written in an imperative language
achieves its effect by changing the value of variables or the attributes of
objects by means of assignment state. Examples are COBOL, C++, C,
PASCAL, ADA and JAVA.
 Procedural languages : centered around the definition of procedures and
many have been extended to support Object oriented programming.
 Functional languages : PURE, MISP, ML
 Logic languages : PROLOG
The factors that affect the development of a broad category of languages
include:
 Expressive power: it includes the number of types and their associated
operations, the readability of the language. A laguage with high
expressive power enables solutions to be expressed in terms of the
problem being solved rather than in terms of computer.
 Simplicity and orthogonality: allows programs to be expresses in a
concisely written manner.
 Implementation : use of interpreters, compilers and virtual machines.
 Error detection and correction: done through program testing ussually
not an easy task
 Correctness and Standards: proving that the program satisfies the
originalspecification.
4. lexical elements : character set, identifiers and reserved words, comments,
space and line termination

CHAPTER 2: Historical Survey


1. Ojective : understand the development of existing languages and pinpoint the errors
made in the past and avoid to repeat them.

2. FORTRAN: meaning FORMULA TRANSLATING SYSTEM, developed by IBM,


was first released in 1956, and correct versions bought up in 1958.
example of a fortran program
C FORTRAN PROGRAM TO FIND MEAN OF N NUMBERS AND
C NUMBER OF VALUES GREATER THAN THE MEAN //comments
DIMENSION A(99)
REAL MEAN
READ(1,5)N
5 FORMAT(I2)
READ(1,lO)(A(1),I=1,N)
10 FORMAT(6F10.5)
SUM=O.0
DO 15 I=1,N
*
15 SUM=SUM+A(I)
MEAN=SUM/FLOAT(N)
rnBER=0
DO 20 I=l,N
IF (A(1).LE. MEAN) GOT0 20
NUMBER=NUMBER+l
20 CONTINUE
WRITE(2.25) MEAN,NUMBER
25 FORMAT(8H MEAN = ,F10.5,5X,20HNUMBER OVER MEAN = ,I5)
STOP
END

The development of this language had problems such as relunctance of programmers to


use other programming languages, no standard for Fortran and slightly different
performance of compilers.

3. ALGOL originally known as IAL and lather ALGOL(algorithmic language). The


objectives of this language were clearly stated and included :
 It should be as close as possible to standard mathematical notation and be
readable
without too much additional explanation.
 It should be possible to use it for the description of computing processes in publi
cations.
 It should be mechamcally translatable into machine code

The following Algol 60 program solves the problem of findlng the mean of
numbers and how many numbers are greater than the mean.
begin
comment this program finds the mean of n numbers
and the number of values greater than the mean;
integer n;
read(n);
begin
real array a [l:nl ;
integer i, number;
real sum, mean;
for i := 1 step 1 until n do
read (a[il);
sum : = 0.0;
for i : = 1 step 1 until n do
sum : = sum + alil;
mean : = sum / n;
number : = 0;
for i : = 1 step 1 until n do
if a[il > mean then
number : = number + 1;
write ("MEAN= " , mean, "NUMBER OVER MEAN =
"
, number)
end
end

Algol later had a strong influence on subsequent languages .


4. PASCAL : developed by Niklaus Wirth in the late 1960’s and early 1970’s, built using
Algol w. l W. His aims were to produce a language that could b
efficiently implemented on most computers andbe suitable for teaching programming a
a logical and systematic discipline, thus encouraging well-structured and well-organise
programs. Although Pascal is a direct descendant of Algol 60, there was a determine
effort by Wirth to make his language efficient.

5.COBOL : common business oriented language developed by FLOW-MATIC. It is


essentially a data processing language.

6. Special purpose languages : string manipulation laguage : SNOBOL, COMIT.


7. List processing languages
8. Simulation languages : GPSS, SIMULA,
9. Scripting languages : PERL, AWK
10. System programming languages : C, OCCAM
11. Abstract data types languages : C, C++, JAVA, ADA , DELPHI, EIFFEL,
SMALLTALK, MODULA-2.
12. Functional and logic languages : PROLOG
CHAPTER 3 : TYPES, VALUES AND DECLARATIONS

1. Data items have names, references or addresses and the stored value
2.variables do have a scope which can be global or local
3. interger numbers are represented exactly in a computer while the
representation of floating point numbers is only approximate
4. most high level languages use built in character types with character
operations. Some languages treat characters as scalars eg PERL, others
manipulate them using Arrays of characters such languages are C, C+
+,PASCAL, ADA still others have whole string library class for the
manipulation of characters like JAVA.
5.Enumeration types are user-defined types used to make programs more
readable.
6.reference variables have an adress as their value, in C, C++ pointers are
used in arithmetic operations involving variables.

CHAPTER 4 : EXPRESSIONS AND STATEMENT

1. Definition
 expressions are composed of two or more operands combined by an
operator.
 boolean expressions are those who contain boolean type variables and
boolean type operators.
 statements are the commands in a language which perform actions and
change the state.

2. the mostly known selection statement is the if mostly used in early


languages
3.iterative statements include WHILE, LOOP, FOR,
4. exception handling in most languages can be done by using exception in
sequence statement other languages such as JAVA use try block to handle
exceptions

You might also like