$30 off During Our Annual Pro Sale. View Details »

CSE240 Lecture 02

CSE240 Lecture 02

Introduction to Programming Languages
History of Programming Languages, Paradigms, and Features
(201701)

Javier Gonzalez-Sanchez
PRO

January 02, 2017
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSE 240
    Introduction to Programming Languages
    Lecture 02: History of Programming Languages, Paradigms, and Features
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu | javiergs.com
    PERALTA 230U
    Office Hours: By appointment

    View Slide

  2. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 2
    jgs
    Machine Language
    Hardware
    Machine Language

    View Slide

  3. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 3
    jgs
    Programming Languages
    Machine language
    A program is a sequence of bytes (binary numbers) stored
    in memory. The CPU interprets the program in the
    specified order.
    1940
    00000001 00000011
    00000001 00000101
    00000010 00000010
    00000011 00000111

    View Slide

  4. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 4
    jgs
    Programming Languages
    Assembly Language
    Use of letters and numbers (hexadecimal or decimal) led
    to programming becoming more sophisticated (e.g., Intel
    assembly, MIPS, and similar to a bytecode for Java).
    Requires a program (assembler) to translate assembly
    language to machine code
    1947
    LOD 3
    LOD 5
    OPR 2
    STO 7
    00000001 00000011
    00000001 00000101
    00000010 00000010
    00000011 00000111

    View Slide

  5. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 5
    jgs
    Assembly Language
    Hardware
    Machine Language
    Assembly Language

    View Slide

  6. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 6
    jgs
    Programming Languages
    High-level languages
    Higher level programming languages, such as Autocode,
    FORTRAN, COBOL, LISP, Scheme, and C.
    • Variables of different types (real, integer, array)
    • Procedures or functions
    • Control structures
    Requires a program (compiler) to translate to assembly language
    and a program (assembler) to translate it to machine code
    1952
    LOD 3
    LOD 5
    OPR 2
    STO 7
    x = 3 + 5;
    00000001 00000011
    00000001 00000101
    00000010 00000010
    00000011 00000111

    View Slide

  7. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 7
    jgs
    Language Levels
    Hardware
    Machine Language
    Assembly Language
    High-Level Language
    C
    Fortran
    C++
    Java

    View Slide

  8. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 8
    jgs
    Paradigms
    x = 2 + 3;
    do { }
    while(true) ;
    int x = 5;
    (= X (SUM 2 3))
    ( repeat 0 10)
    (5)
    x ß 2 + 3.
    for 1 to 10
    x := (number)5.
    What is
    the result of
    two plus three?

    View Slide

  9. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 9
    jgs
    Paradigms
    § Basic assumptions, ways of thinking, and methodology
    § that are commonly accepted
    § by members of a group or community.

    View Slide

  10. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 10
    jgs
    Paradigms

    View Slide

  11. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 11
    jgs
    Paradigms

    View Slide

  12. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 12
    jgs
    The Four Main Paradigms and their Features
    Imperative or Procedural Paradigm
    Key idea:
    Fully specified and fully controlled
    manipulation of named data in a step-wise
    fashion.
    Features:
    • Divide the program into reasonable sized
    pieces named functions or procedures or
    modules or subroutines…
    • Local and global variables
    • Data structures
    • Conditional and loop statements

    View Slide

  13. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 13
    jgs
    The Four Main Paradigms and their Features
    Object-oriented Paradigm
    Key idea:
    encapsulation of data and
    functionality of the program in
    objects.
    Features:
    • Inheritance and polymorphism
    • Class vs Instance variables
    (static)
    • Public, private, protected

    View Slide

  14. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 14
    jgs
    The Four Main Paradigms and their Features
    Functional Paradigm
    Key idea:
    Focus on higher level of abstraction (free
    from programming details)
    Features:
    • simpler semantics
    • closer to mathematical functions

    View Slide

  15. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 15
    jgs
    The Four Main Paradigms and their Features
    Logic/Declarative Paradigm
    Key idea:
    A program is a set of facts about objects,
    rules about objects, and questions about
    the relations between objects.
    Features:
    • get rid of programming altogether.
    male(james1).
    male(charles1).
    female(catherine).
    female(elizabeth).
    parent(charles1, james1).
    parent(elizabeth, james1).
    parent(catherine, charles1).
    % Was George I
    % the parent of Charles I?
    parent(charles1, george1).
    % Who was Charles I's parent?
    parent(charles1,X).
    % Who were the children of
    % Charles I?
    parent(X,charles1).

    View Slide

  16. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 16
    jgs
    Summary
    Time
    Abstraction Level – Hiding complexity
    50s 60s 70s 80s 90s 00s 10s
    Logic
    Programming
    e.g. Prolog
    Imperative/
    Procedural
    Programming
    e.g. C
    Object-Oriented
    Programming
    e.g. C++ and Java
    Functional
    Programming
    e.g. LISP

    View Slide

  17. Javier Gonzalez-Sanchez | CSE240 | Fall 2021 | 17
    jgs
    Reference
    Read Textbook Chapter 1 (section 1.1)

    View Slide

  18. jgs
    CSE 240 Introduction to Programming Languages
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Fall 2021
    Copyright. These slides can only be used as study material for the class CSE240 at Arizona State University.
    They cannot be distributed or used for another purpose.

    View Slide