PROGRAMMING LANGUAGES
& PARADIGMS
Introduction to ComputingCHAPTER # 8
Introduction to Computing 2Chapter # 8
Paradigm vs Language
 Programming Paradigm
 programming “technique”
 way of thinking about programming
 view of a program
 Programming Language
 consists of words, symbols, and rules for writing a program
Introduction to Computing 3Chapter # 8
Programming Paradigms
 Imperative/Procedural Programming
 also called Structured or Procedural
 program as a collection of statements and procedures affecting
data (variables)
 example languages: FORTRAN, BASIC, COBOL, Pascal, C
 Object-Oriented Programming
 program as a collection of classes for interacting objects
 example Languages: SmallTalk, C++, Java
 Functional Programming
 program as a collection of (math) functions
 example Languages: LISP, ML, Haskell
 Logic Programming
 program defines a set of relations
 example language: Prolog
Introduction to Computing 4Chapter # 8
Programming Paradigms
Paradigm Feature
Imperative style
program = algorithms + data
good for decomposition
Functional style
program = functions o functions
good for reasoning
Logic programming style
program = facts + rules
good for searching
Object-oriented style
program = objects + messages
good for modeling
Introduction to Computing 5Chapter # 8
Programming Language
 A programming language is a tool for developing
executable models for a class of problem domains
 It is a language that is intended for the expression of
computer programs and that is capable of expressing
any computer program
 Why study programming languages?
 Programming languages are important for students in
all disciplines of computer science because they are
the primary tools of the central activity of computer
science
Introduction to Computing 6Chapter # 8
History of Famous Programming Languages
 50s and 60s :
 Early high level languages : FORTRAN, COBOL, ALGOL60
 Early mathematical based languages : LISP, APL, SNOBOL
 General-purpose language : PL/1
 Next leap forward: Algol68, SIMULA67, BASIC
 70s:
 High level and structured programming: Pascal
 Systems programming: C, modula-2
 Logical programming: Prolog
 Improvement of functional programming: Scheme
Introduction to Computing 7Chapter # 8
History of Famous Programming Languages
 80s:
 Development of functional programming: ML, Miranda
 Need for reliability and maintainability: Ada
 Object-oriented programming: Smalltalk, C++
 90s:
 Fourth-generation languages
 Productivity tools (such as spreadsheets)
 Visual languages : Delphi
 Scripting languages : Perl
 Expert systems shells
 Network computing : Java
Introduction to Computing 8Chapter # 8
Chronology of Programming Languages
Early 1950s “order codes” (primitive assemblers)
1957 FORTRAN the first high-level programming language
1958 ALGOL the first modern, imperative language
1960 LISP, COBOL Interactive programming; business programming
1962 APL, SIMULA the birth of OOP (SIMULA)
1964 BASIC, PL/I imperative
1966 ISWIM first modern functional language (a proposal)
1970 Prolog logic programming is born
1972 C the systems programming language
1975 Pascal, Scheme two teaching languages
1978 CSP Concurrency matures
1978 FP Backus’ proposal
1983 Smalltalk-80, Ada OOP is reinvented
1984 Standard ML FP becomes mainstream
1986 C++, Eiffel OOP is reinvented (again)
1988 CLOS, Oberon, Mathematica FP
1990 Haskell FP is reinvented
1990s Perl, Python, Ruby, JavaScript Scripting languages become mainstream
1995 Java OOP is reinvented for the internet
2000 C# OOP
Introduction to Computing 9Chapter # 8
Categories of Programming Languages
 Programming languages fall into two main categories
with respect to their level broad categories or into 5
generations
 Low Level Languages
 First generation languages (Machine languages)
 Second generation languages (Assembly languages)
 Higher Level languages
 Third generation languages
 Fourth generation languages
 Fifth generation languages
Introduction to Computing 10Chapter # 8
Low Level Languages
 These are more closer to the hardware
 Difficult to program
 Execute more faster than the high level languages
 Low level programming languages are divided into
two generations, each more powerful than the last
 First generation languages (Machine language)
 Second generation languages (Assembly language)
Introduction to Computing 11Chapter # 8
Higher Level Languages
 More powerful than low level languages
 Allow the programmer to work in a more English-like
environment
 Higher level programming languages are divided into
three generations, each more powerful than the last
 Third generation languages
 Fourth generation languages
 Fifth generation languages
Introduction to Computing 12Chapter # 8
First Generation Languages
 Machine language
 The most basic type of computer languages
 Consist of strings of numbers the computer's
hardware can use
 Different types of hardware use different machine
code
 for example, IBM computers use different machine
language than Apple computers
Introduction to Computing 13Chapter # 8
Second Generation Languages
 Assembly language
 Only somewhat easier to work with than machine
languages
 Developers use cryptic English-like phrases to
represent strings of numbers
 One-to-one correspondence between machine
instructions and assembly instructions
 Programmer must think like the machine
 Inherently machine-dependent
 Converted to machine language by a program called
an assembler
Introduction to Computing 14Chapter # 8
Third Generation Languages
 Third generation languages (3GLs) are the first to use
true English-like phrasing, making them easier to use
than previous languages
 They are portable
 meaning the object code created for one type of system can be
translated for use on a different type of system
 The following languages are 3GLs
 FORTAN
 C
 C++
 COBOL
 BASIC
 Java
 Pascal
Introduction to Computing 15Chapter # 8
Fourth Generation Languages
 Fourth generation languages (4GLs) are even easier
to use than 3GLs
 4GLs may use a text-based environment (like a 3GL)
or may allow the programmer to work in a visual
environment, using graphical tools
 The following languages are 4GLs
 Visual Basic (VB)
 Visual Age
 Authoring environment
 UML
Introduction to Computing 16Chapter # 8
Fifth Generation Languages
 Fifth-generation languages (5GLs) are an issue of
debate in the programming community
 some programmers do agree that they even exist
 These high-level languages would use artificial
intelligence to create software
 making 5GLs extremely difficult to develop
 Solve problems using constraints rather than
algorithms, used in Artificial Intelligence
 Prolog
Introduction to Computing 17Chapter # 8
Attributes of a Good Programming Language
 Clarity, simplicity, and unity
 Have a minimum number of different concepts, with the
rules for their combination, simple and regular (conceptual
integrity)
 readability
 Orthogonality
 Being able to combine various features of a language in all
possible combinations
 Naturalness for the application
 Support for abstraction
Introduction to Computing 18Chapter # 8
Attributes of a Good Programming Language
 Ease of program verification
 Proof of correctness, desk checking, test
 Simplicity of semantic and syntax
 Programming environment
 Portability of programs
 Cost of use
 Program execution
 Program translation
 Program creation, testing, and use
 Program maintenance
Introduction to Computing 19Chapter # 8
Attributes of a Good Programming Language
 Reliability
 Write ability
 Read ability
 Simplicity
 Safety (no go to, no pointers)
 Robustness (undesired events can be trapped, like
arithmetic overflow, invalid inputs)
 Maintainability
 Factoring (modularity)
 Locality
 Efficiency

Itc chapter # 8

  • 1.
  • 2.
    Introduction to Computing2Chapter # 8 Paradigm vs Language  Programming Paradigm  programming “technique”  way of thinking about programming  view of a program  Programming Language  consists of words, symbols, and rules for writing a program
  • 3.
    Introduction to Computing3Chapter # 8 Programming Paradigms  Imperative/Procedural Programming  also called Structured or Procedural  program as a collection of statements and procedures affecting data (variables)  example languages: FORTRAN, BASIC, COBOL, Pascal, C  Object-Oriented Programming  program as a collection of classes for interacting objects  example Languages: SmallTalk, C++, Java  Functional Programming  program as a collection of (math) functions  example Languages: LISP, ML, Haskell  Logic Programming  program defines a set of relations  example language: Prolog
  • 4.
    Introduction to Computing4Chapter # 8 Programming Paradigms Paradigm Feature Imperative style program = algorithms + data good for decomposition Functional style program = functions o functions good for reasoning Logic programming style program = facts + rules good for searching Object-oriented style program = objects + messages good for modeling
  • 5.
    Introduction to Computing5Chapter # 8 Programming Language  A programming language is a tool for developing executable models for a class of problem domains  It is a language that is intended for the expression of computer programs and that is capable of expressing any computer program  Why study programming languages?  Programming languages are important for students in all disciplines of computer science because they are the primary tools of the central activity of computer science
  • 6.
    Introduction to Computing6Chapter # 8 History of Famous Programming Languages  50s and 60s :  Early high level languages : FORTRAN, COBOL, ALGOL60  Early mathematical based languages : LISP, APL, SNOBOL  General-purpose language : PL/1  Next leap forward: Algol68, SIMULA67, BASIC  70s:  High level and structured programming: Pascal  Systems programming: C, modula-2  Logical programming: Prolog  Improvement of functional programming: Scheme
  • 7.
    Introduction to Computing7Chapter # 8 History of Famous Programming Languages  80s:  Development of functional programming: ML, Miranda  Need for reliability and maintainability: Ada  Object-oriented programming: Smalltalk, C++  90s:  Fourth-generation languages  Productivity tools (such as spreadsheets)  Visual languages : Delphi  Scripting languages : Perl  Expert systems shells  Network computing : Java
  • 8.
    Introduction to Computing8Chapter # 8 Chronology of Programming Languages Early 1950s “order codes” (primitive assemblers) 1957 FORTRAN the first high-level programming language 1958 ALGOL the first modern, imperative language 1960 LISP, COBOL Interactive programming; business programming 1962 APL, SIMULA the birth of OOP (SIMULA) 1964 BASIC, PL/I imperative 1966 ISWIM first modern functional language (a proposal) 1970 Prolog logic programming is born 1972 C the systems programming language 1975 Pascal, Scheme two teaching languages 1978 CSP Concurrency matures 1978 FP Backus’ proposal 1983 Smalltalk-80, Ada OOP is reinvented 1984 Standard ML FP becomes mainstream 1986 C++, Eiffel OOP is reinvented (again) 1988 CLOS, Oberon, Mathematica FP 1990 Haskell FP is reinvented 1990s Perl, Python, Ruby, JavaScript Scripting languages become mainstream 1995 Java OOP is reinvented for the internet 2000 C# OOP
  • 9.
    Introduction to Computing9Chapter # 8 Categories of Programming Languages  Programming languages fall into two main categories with respect to their level broad categories or into 5 generations  Low Level Languages  First generation languages (Machine languages)  Second generation languages (Assembly languages)  Higher Level languages  Third generation languages  Fourth generation languages  Fifth generation languages
  • 10.
    Introduction to Computing10Chapter # 8 Low Level Languages  These are more closer to the hardware  Difficult to program  Execute more faster than the high level languages  Low level programming languages are divided into two generations, each more powerful than the last  First generation languages (Machine language)  Second generation languages (Assembly language)
  • 11.
    Introduction to Computing11Chapter # 8 Higher Level Languages  More powerful than low level languages  Allow the programmer to work in a more English-like environment  Higher level programming languages are divided into three generations, each more powerful than the last  Third generation languages  Fourth generation languages  Fifth generation languages
  • 12.
    Introduction to Computing12Chapter # 8 First Generation Languages  Machine language  The most basic type of computer languages  Consist of strings of numbers the computer's hardware can use  Different types of hardware use different machine code  for example, IBM computers use different machine language than Apple computers
  • 13.
    Introduction to Computing13Chapter # 8 Second Generation Languages  Assembly language  Only somewhat easier to work with than machine languages  Developers use cryptic English-like phrases to represent strings of numbers  One-to-one correspondence between machine instructions and assembly instructions  Programmer must think like the machine  Inherently machine-dependent  Converted to machine language by a program called an assembler
  • 14.
    Introduction to Computing14Chapter # 8 Third Generation Languages  Third generation languages (3GLs) are the first to use true English-like phrasing, making them easier to use than previous languages  They are portable  meaning the object code created for one type of system can be translated for use on a different type of system  The following languages are 3GLs  FORTAN  C  C++  COBOL  BASIC  Java  Pascal
  • 15.
    Introduction to Computing15Chapter # 8 Fourth Generation Languages  Fourth generation languages (4GLs) are even easier to use than 3GLs  4GLs may use a text-based environment (like a 3GL) or may allow the programmer to work in a visual environment, using graphical tools  The following languages are 4GLs  Visual Basic (VB)  Visual Age  Authoring environment  UML
  • 16.
    Introduction to Computing16Chapter # 8 Fifth Generation Languages  Fifth-generation languages (5GLs) are an issue of debate in the programming community  some programmers do agree that they even exist  These high-level languages would use artificial intelligence to create software  making 5GLs extremely difficult to develop  Solve problems using constraints rather than algorithms, used in Artificial Intelligence  Prolog
  • 17.
    Introduction to Computing17Chapter # 8 Attributes of a Good Programming Language  Clarity, simplicity, and unity  Have a minimum number of different concepts, with the rules for their combination, simple and regular (conceptual integrity)  readability  Orthogonality  Being able to combine various features of a language in all possible combinations  Naturalness for the application  Support for abstraction
  • 18.
    Introduction to Computing18Chapter # 8 Attributes of a Good Programming Language  Ease of program verification  Proof of correctness, desk checking, test  Simplicity of semantic and syntax  Programming environment  Portability of programs  Cost of use  Program execution  Program translation  Program creation, testing, and use  Program maintenance
  • 19.
    Introduction to Computing19Chapter # 8 Attributes of a Good Programming Language  Reliability  Write ability  Read ability  Simplicity  Safety (no go to, no pointers)  Robustness (undesired events can be trapped, like arithmetic overflow, invalid inputs)  Maintainability  Factoring (modularity)  Locality  Efficiency