programming paradigms chapter 1

Upload: hiruma-youichi

Post on 07-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Programming Paradigms Chapter 1

    1/17

    CSC305 (PROGRAMMING PARADIGMS)

    Lecture 1 : Introduction To Programming Paradigms

    1SEMESTER JAN APR 09

  • 8/6/2019 Programming Paradigms Chapter 1

    2/17

    REASONS TO STUDY CONCEPTS OF

    PROGRAMMING LANGUAGES

    1. Increase the ability to express ideas

    2. Improve background for choosingthe appropriate languages

    3. Increase the ability to learn newlanguages

    4. Better understanding on the

    significance of softwareimplementation

    5. Overall advancement of computing

    2SEMESTER JAN APR 09

  • 8/6/2019 Programming Paradigms Chapter 1

    3/17

  • 8/6/2019 Programming Paradigms Chapter 1

    4/17

    HISTORY OF PROGRAMMING

    LANGUAGES

    SEMESTER JAN APR 09 4

    The Abacus

    The Pascaline

    AutomaticCalculator

    Jacquard Loom

    The Difference

    Engine

  • 8/6/2019 Programming Paradigms Chapter 1

    5/17

    HISTORY OF PROGRAMMING

    LANGUAGES

    SEMESTER JAN APR 09 5

    Years Details

    1842 Ada Augusta Bryon

    the first computer programmer

    innovations1. subroutine2. looping

    1937 The Universal Machine

    Alan Turing

    1940s The ENIAC (1942)

    The Von Neumann Concepts1. shared-program techniques2. conditional control transfer

    Konrad Zuse & Plankalkul first algorithmic programming language defined circa 1945 but never implemented

    Plankalkul

    algorithms in the language include a program to play chess

    finally published in 1976

    include some advanced data types such as floating point, arrays &records

  • 8/6/2019 Programming Paradigms Chapter 1

    6/17

    THE FIRST PROGRAMMING

    LANGUAGES (1950s)

    SEMESTER JAN APR 09 6

    Languages &

    Years

    Details

    Pseudocodes

    (1949) the first high level programming language

    1. Short Code : John Mauchly (1949)

    expression were coded left to right

    hand compiled

    2. Speed Coding : John Backus (1953 / 54) conditional & unconditional branching

    interpreter left only 700 words for user program

    3. Laning & Zieler System (1953)

    subscripted variables, function calls & expression

    translation

    FORTRAN(1954 - 57)

    FORmula TRANslator developed at IBM under the guidance of John Backus

    primarily for scientific, computational programming

    dramatically changed forever the ways computers are used

    has continued to evolved

    among the most efficient compilers for producing Fastcode

  • 8/6/2019 Programming Paradigms Chapter 1

    7/17

    THE FIRST PROGRAMMING

    LANGUAGES (1950s)

    SEMESTER JAN APR 09 7

    Languages& Years

    Details

    COBOL(1959)

    Common Business Oriented Language the first business oriented language based on FLOW-MATIC

    names up to 12 characters, with embeddedhyphens English names for arithmetic operators data & code were completely separated

    contributions:

    1. first micro facility in a high level language2. hierarchical data structures (records)3. nested selection statements4. long names (up to 30 characters) with

    hyphens5. data division

  • 8/6/2019 Programming Paradigms Chapter 1

    8/17

    THE FIRST PROGRAMMING

    LANGUAGES (1950s)

    SEMESTER JAN APR 09 8

    Languages &

    Years

    Details

    LISP

    (1959)

    List Processing language

    designed at MIT by John McCarthy

    AI research needed a language that:

    1. process data in l ists

    2. symbolic computation

    one universal recursive data type : s-expression syntax is based on Lambda Calculus pioneered functional programming

    no need for variables or assignment control via recursion & conditional expressions

    programs-as-data

    garbage collection

    Algol 58

    semicolon as a statement separator assignment operator was :=

    if had an else if clause

    compound statement (begin .. end)

    concept of type formalized

    names could be of any length

    arrays could have any number of subscripts

    parameters were separated by mode (in & out)

  • 8/6/2019 Programming Paradigms Chapter 1

    9/17

    THE FIRST PROGRAMMING

    LANGUAGES (1950s)

    SEMESTER JAN APR 09 9

    Languages& Years

    Details

    Algol 60 block structure (local scope) 2 parameter passing methods subprogram recursion stack dynamic arrays no I/O & no string handling successes:

    1. standard way to publish algorithms forover 20 years

    2. all subsequent imperative languages arebased on it

    3. first machine independent language4. first language with formally defined syntax

    (BNF)5. never widely used

  • 8/6/2019 Programming Paradigms Chapter 1

    10/17

    AN EXPLOSION IN PROGRAMMING

    LANGUAGES (1960s)

    SEMESTER JAN APR 09 10

    Languages& Years

    Details

    PL / I(1963 / 64)

    good for scientific & business applications

    eventually grew to include virtually idea in current practicalprogramming languages translator were slow, huge & unreliable

    contributions:1. first unit level concurrency2. first exception handling3. switch selectable recursion4. first pointer data type

    BASIC(1964)

    Beginners All purpose Symbolic Instruction Code

    designed by Kemeny & Kurtz at Dartmouth

    goals:

    1. easy to learn & use for non science students & as a path toFORTRAN and Algol

    2. pleasant & friendly3. fast turnaround for homework4. free & private access5. user time is more important than computer time6. well suited for implementation on first PCs

  • 8/6/2019 Programming Paradigms Chapter 1

    11/17

    SIMPLICITY, ABSTRACTION,

    STUDY (70s)

    SEMESTER JAN APR 09 11

    Languages

    & Years

    Details

    C aim for simplicity by reducing restrictions of the type system

    allows access to underlying system

    interface with OS - UNIX

    Pascal designed by Niklaus Wirth designed for teaching structured programming

    small & simple

    introduces some modest improvements, such as the case

    statement

    was widely used for teaching programming (1980 - 1995)

    C(1972)

    designed for systems programming at Bell Labs by Dennis Richie& colleagues

    powerful set of operators, but poor type checking

    initially spread through UNIX & the availability of high quality,

    free compilers

    memory model is close to underlying hardware

    flexible

  • 8/6/2019 Programming Paradigms Chapter 1

    12/17

  • 8/6/2019 Programming Paradigms Chapter 1

    13/17

    CONSOLIDATION & NEW

    PARADIGMS (1980s)

    SEMESTER JAN APR 09 13

    Languages &Years

    Details

    Ada(1979)

    primarily known as DoD-1

    contributions:1. packages support for data abstraction2. exception handling3. generic program units4. concurrency

    LogicProgramming

    based on formal logic

    operational basis: solving queries relative to theory represented byprogram1972: PROLOG (PROgramming in LOGic)

    unification goal seeking with backtracking

    FunctionalProgramming

    Common Lisp : consolidation of LISP dialects spurred practical use

    Scheme : a simple & pure LISP like language used for teachingprogramming Logo : used for teaching young children how to program

    Haskell : polymorphicaly typed, lazy, purely functional language

  • 8/6/2019 Programming Paradigms Chapter 1

    14/17

    CONSOLIDATION & NEW

    PARADIGMS (1980s)

    SEMESTER JAN APR 09 14

    Languages &Years

    Details

    ML Meta Language

    strongly typed functional language

    first developed by Robin Miller intended for interactive use

    combination of LISP & Algol like features:1. expression oriented2. higher order functions3. garbage collection4. abstract data types5. module system6. exceptions

    Simula 67 first OO language designated for simulation

    later recognized as general purpose programming language extension of Algol 60

    standardized as Simula in 1977

    inspiration to many later designers

  • 8/6/2019 Programming Paradigms Chapter 1

    15/17

  • 8/6/2019 Programming Paradigms Chapter 1

    16/17

    THE INTERNET (1990s)

    SEMESTER JAN APR 09 16

    Languages

    & Years

    Details

    Perl

    (1987) Practical Extraction and Reporting Language

    interpreted scripting language

    original application : system administration & data

    reduction data manipulation

    rapid application development block structured, also supports OO

    associative arrays instead of records or structures

    Java(early 1990s)

    developed by James Gosling & others at SunMicrosystems original goal : a language for embedded computers

    original name : Oak started as reimplementation of C++

    has references, no pointers

    includes support for Applets & concurrency

  • 8/6/2019 Programming Paradigms Chapter 1

    17/17

    PROGRAMMING DOMAINS

    SEMESTER JAN APR 09 17

    Programming Domains Purpose

    FORTRAN Scientific applications

    COBOL Business applications

    LISP, Prolog Artificial intelligence

    PL/S, BLISS, Extended Algol, C System programming

    sh, awk, Perl Scripting languages

    LISP, COGO, APT Special purpose languages