0% found this document useful (0 votes)
2 views

Lecture 2

Chapter 2 discusses the evolution of major programming languages, tracing their development from machine languages to modern high-level languages. It outlines the program development life cycle (PDLC) and categorizes programming languages into generations, highlighting key languages like Fortran, COBOL, and Java. The chapter also emphasizes the importance of structured and modular programming, as well as the role of object-oriented programming in contemporary software development.

Uploaded by

ENES
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture 2

Chapter 2 discusses the evolution of major programming languages, tracing their development from machine languages to modern high-level languages. It outlines the program development life cycle (PDLC) and categorizes programming languages into generations, highlighting key languages like Fortran, COBOL, and Java. The chapter also emphasizes the importance of structured and modular programming, as well as the role of object-oriented programming in contemporary software development.

Uploaded by

ENES
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Chapter 2

Evolution of the
Major Programming
Languages
Tentative Course Outline

1. Preliminaries -Introduction to Programming Languages


2. Evolution of the Major Programming Languages
3. Describing Syntax and Semantics
4. Names, Bindings, and Scopes
5. Data Types
6. Expressions and Assignment Statements
7. Statement-Level Control Structures
8. Subprograms
9. Implementing Subprograms
10. Abstract Data Types and Encapsulation Concepts
11. Support for Object-Oriented Programming
12. Concurrency
13. Exception Handling and Event Handling
14. Functional Programming Languages
Chapter 2 Topics

• Computer Programming Languages


• Development of Programming Languages
• Program Development Life Cycle (PDLC)

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-3


Computer Programming Languages

Machine Language Assembly Language


Fortran Pascal
COBOL
BASIC Ada
Visual Basic
C and C++ Java
Smalltalk

• Programming languages are artificial languages created to tell the computer what to do.
• They consist of vocabulary and a set of rules to write programs.
• The program development life cycle (PDLC) is an organized method of software
development.

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-4


Development of
Programming
Languages

Genealogy of Common
Languages

• The genealogy of common


programming languages traces their
evolution from early machine-level
code to modern, high-level
paradigms.

• C, in turn, became the ancestor of


many modern languages, including
C++, Java, and C#.

• Lisp pioneered functional


programming, inspiring languages
like Scheme, Haskell, and modern
JavaScript features.

• The 1990s saw the rise of Python,


which emphasized readability and
versatility, influencing later
languages such as Go and Rust.

• JavaScript, developed for web


development.

1-5
Copyright © 2017 Pearson Education, Ltd. All rights reserved.
Development of Programming Languages

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-6


Development of Programming Languages, 1960's

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-7


Development of Programming Languages, 1970’s

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-8


Development of Programming Languages, 1980’s

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-9


Development of Programming Languages, 1990’s

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-10


Development of Programming Languages, 2000’s

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-11


Development of Programming Languages

• Programming languages are classified by levels or generations.


• Lower-level languages are the oldest.
• The generations of programming languages are:
– Machine languages (1 st )
– Assembly languages (2nd)
– Procedural languages (3rd)
– Problem-oriented languages (4th)

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-12


Development of Programming Languages

First-Generation Languages

• Machine language:
– Consists of binary numbers (0s
and 1s)
– Is the earliest programming
language
– Is the only language the
computer understands without
translation
– Is machine dependent
• Each family of processors
has its own machine
language

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-13


Development of Programming Languages

Second-Generation Languages

• Assembly language:
– Resembles machine language
– Is a low-level language
– Uses brief abbreviations for
program instructions.
– A program is written in
source code (text file) and
translated into machine
language by an assembler

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-14


Development of Programming Languages

Third-Generation Languages

• Procedural languages:
– Are high-level languages that tell the computer what to do and how to do it
– Create programs at a high level of abstraction
– Are easier to read, write, and maintain than machine and assembly languages
– Use a compiler or interpreter to translate code
• Fortran and COBOL are third-generation languages

Procedural programming languages : the program is divided into smaller sections or units,
often called functions, procedures, or routines, each responsible for performing specific tasks.
The primary focus is on the sequence of steps that lead to the desired result, and the program
execution follows a linear or structured flow.
• Functions/Procedures, Sequential Execution, Variables, Control Structures: if-else
statements, loops (for, while), switch/case

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-15


Details of Programming Languages

Fortran (Formula Translator)

• First implemented version of Fortran • Distributed in 1958


– Names could have up to six characters - Independent compilation
– Post-test counting loop (DO) - Fixed the bugs
– User-defined subprograms Fortran II
– Compiler released in April 1957, after 18 worker-
years of effort
– Programs larger than 400 lines rarely compiled
correctly, mainly due to poor reliability of 704 • Evolved during 1960-62
– Code was very fast
– Quickly became widely used Fortran IV

Fortran I

1-16
Copyright © 2017 Pearson Education, Ltd. All rights reserved.
Details of Programming Languages

Fortran (Formula Translator)

• Became the new standard in 1978


– Character string handling Fortran 77
– Logical loop control statement
– IF-THEN-ELSE statement

• Most significant changes from Fortran 77


– Modules
– Dynamic arrays
– Pointers
– Recursion Latest versions of Fortran
– CASE statement Fortran 95
Fortran 2003
– Parameter type checking Fortran 2008
Fortran 90

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-17


Details of Programming Languages

Fortran (Formula Translator)

• Is suited to scientific, mathematical, and


engineering applications
• Is used to solve complex equations
• Features simplicity and ease of use
Details of Programming Languages

Cobol (Common Business-Oriented Language)

• The most widely used


business language
• A proven way to do
accounting, inventory,
billing, and payroll
• Requires programmers to
explain what the program
is doing at each step

Sample Cobol program


Copyright © 2017 Pearson Education, Ltd. All rights reserved.
Development of Programming Languages

Compilers and Interpreters

• A compiler is a program that changes source code to object code.


• Object code is usually the intermediate code of a program that has been
compiled and made executable.
• An interpreter translates source code one line at a time and executes the
instruction.

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-20


Development of Programming Languages

• Structured programming languages:


– Were developed to improve software development
– Include Algol and Pascal
– Forbid the use of GOTO statements
– Use control structures
• IF-THEN-ELSE

Structured programming languages break down programs into smaller, logically organized
components, making the flow of control clear and avoiding unstructured control flows
like GOTO statements.
• Sequential Execution, Control Structures: Selection (if-else), Iteration (loops),
Modularity: Programs are broken into smaller, manageable units
like functions or procedures, block Structures

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-21


Development of Programming Languages

Algol 58

• Concept of type was formalized


• Names could be any length
• Arrays could have any number of subscripts
• Parameters were separated by mode (in & out)
• Subscripts were placed in brackets
• Compound statements (begin ... end)
• Semicolon as a statement separator
• Assignment operator was :=
• if had an else-if clause

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-22


Development of Programming Languages

Algol 60

• It was the first to have block structure, recursion, and a formal definition. It is not used now,
but it is the ancestor of most contemporary languages.
• As far as design goes, Algol 60 was without doubt the most important innovation in the
history of programming languages.

Algol 68

• A very elegant design, unmatched till today.


• Full orthogonality.
• Extremely difficult to implement.
• A very clever formal description, unfortunately hard to understand for most potential users.
• Completely unused.

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

Pascal

• A conceptually simplified and cleaned-up successor of Algol 60.


• A great language for teaching structured programming.
• An excellent first language to learn: teaches good programming habits.
• Its later extensions (for example, Delphi) are full-fledged systems programming packages,
as powerful as any Java kit.

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

• Modular programming languages:


– Were developed because of problems in structured programming languages
– Are used to create programs that are divided into separate modules
• Each module carries out a special function
– Require specified input to produce specified output

Modular programming languages : The code is divided into smaller, self-contained units
called modules. Each module encapsulates a specific piece of functionality, which makes the
program easier to develop, understand, maintain, and extend. Modular programming promotes
the use of functions, procedures, or even entire code libraries to break down complex systems
into manageable parts.
• Modularity, Encapsulation: Modules hide their internal implementation details and expose
only necessary interfaces (such as functions or data) to the outside world, reducing
complexity, Reuse, Intermodule Communication, Separation of Concerns

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-25


Development of Programming Languages

Ada

• Incorporates modular programming


• The required language for the U.S.
Defense Department
• Suitable for control of real-time systems
(missiles)

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

Fourth-Generation Languages:

• Types of fourth-generation languages include:


– Report generators
• Languages for printing database reports
– Query languages
• Languages for getting information out of databases
• Fourth-generation languages are nonprocedural
– They do not force programmers to follow procedures to produce results

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-27


Development of Programming Languages

• Object-oriented programming (OOP):


– Relies on component reusability
• The ability to produce program modules that perform a specific task.
– Eliminates the distinction between programs and data
– Uses objects that contain data and procedures

• Objects are units of information that contain data as


well as methods that process and manipulate the data
• Classes of objects:
– Hierarchy or category of objects
– Objects at the top of the category are broader in
scope than the subclass objects
• Inheritance refers to an object’s capacity to “pass
on” its characteristics to its subclasses

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-28


Development of Programming Languages
Basic (Beginner’s All-Purpose Symbolic Instruction Code )

• An easy-to-use language available on personal


computers
• Widely taught in schools as a beginner’s
programming language
• Designed as an interpreted language

Sample BASIC program

QBASIC or FreeBASIC
Copyright © 2017 Pearson Education, Ltd. All rights reserved.
Development of Programming Languages

Visual Basic (VB)

• Is widely used in program


development packages
• Uses event-driven programming
• Enables the programmer to develop
an application by using on-screen
graphical user interfaces

Sample Visual Basic

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

Pascal
• Encourages programmers to write well-
structured programs
• Widely accepted as a teaching language
• Has been updated to reflect new approaches
to programming

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

C
• Combines high-level programming language with assembly language
• Programmers manipulate bits of data within a processing unit
• Difficult to learn and programming is time consuming

Sample C program

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

Lisp

• One of the earliest programming languages.


• Based on the concept of computing by evaluating functions. Very good for symbolic
computing.
• For years, the only language for Artificial Intelligence work.
• Many dialects, two standards (Scheme, Common Lisp). Nice programming environments.

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

Smalltalk

• “100% pure” object-oriented programming


language
• Not often chosen for software development
• Comes complete with a graphical interface and an
integrated programming environment.
• In skilled hands, a powerful tool.

Sample Smalltalk program


Copyright © 2017 Pearson Education, Ltd. All rights reserved.
Development of Programming Languages

C++

• An object-oriented extension of the imperative language C.


• This is a hybrid design, with object orientation added to a completely different base
language.
• Complicated syntax, difficult semantics.
• Very fashionable, very much in demand.

Sample C++ program

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages
Java
• A neat, cleaned up, sized-down
reworking of C++.
• Full object orientation (though not
as consistent as Smalltalk)
• Designed for Internet programming,
but general-purpose.
• It is said (not quite correctly) to be
slow.

Sample Java Program

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Development of Programming Languages

Java
– C and C++ were not satisfactory for embedded electronic devices
• Based on C++
– Significantly simplified (does not include struct, union, enum, and pointer arithmetic
of C++)
– Supports only OOP
– Has references, but not pointers
– Includes support for applets and a form of concurrency

Java Evaluation
• Eliminated many unsafe features of C++
• Supports concurrency
• Libraries for applets, GUIs, database access
• Portable: Java Virtual Machine concept, JIT compilers
• Widely used for Web programming

Copyright © 2017 Pearson Education, Ltd. All rights reserved. 1-37


Program Development Life Cycle (PDLC)

• The PDLC was introduced in the 1970s to address problems in creating programs.
• It provides an organized plan for breaking down the task of program development into
manageable parts.
• Six phases of the PDLC:
1. Defining the problem
2. Designing the program
3. Coding the program
4. Testing and debugging the program
5. Formalizing the solution
6. Implementing and maintaining the program

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Program Development Life Cycle (PDLC)

Phase 1: Defining the Problem


• The first step in program development
• Systems analysts provide program specifications to programmers
• Specifications define:
– Input data
– Processing
– Output
– Appearance of user interface

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Program Development Life Cycle (PDLC)

Phase 2: Designing the Program

• Programmers create the program’s design


– Top-down design focuses on the program’s main goal (main routine), then breaks the
program into manageable components (subroutines/modules)
– Control structures are used to see how each subroutine will do its job
• Developing an algorithm is a step-by-step description of how to arrive at a solution
• Program design tools like :
– Flow charts – show the logic of program
– Pseudo code – alternative to flow charts

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Program Development Life Cycle (PDLC)

Phase 3: Coding the Program

• Coding requires the translation of the algorithm into specific program instructions.
• An appropriate programming language is chosen, and the code is typed according to its
syntax rules.

Phase 4: Testing and Debugging the Program

• Testing and debugging eliminate all errors


• Syntax and logic errors are corrected
• Debugging is the process of eliminating errors

Copyright © 2017 Pearson Education, Ltd. All rights reserved.


Program Development Life Cycle (PDLC)

Phase 5: Formalizing the Solution

• Documentation is created for future use


• The variable names and definitions, a description of the files needed, and the layout of the
output are produced
• A user manual is developed to explain how the program works

Phase 6: Implementing and Maintaining the Program

• The program is:


– Tested by users
– Thoroughly documented
– Maintained and evaluated regularly

Copyright © 2017 Pearson Education, Ltd. All rights reserved.

You might also like