Overview of Programming Paradigms

Slides:



Advertisements
Similar presentations
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
Advertisements

© Peter Andreae What is Programming About COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
PROGRAMMING Introduction To Programming Definition Types Of Programming Languages Programming Language Paradigm Translator
Programming Creating programs that run on your PC
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
The Analytical Engine Module 6 Program Translation.
Computers: Tools for an Information Age
Programming Languages Structure
Chapter 16 Programming and Languages: Telling the Computer What to Do.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
1 Chapter-01 Introduction to Computers and C++ Programming.
PROGRAMMING LANGUAGES The Study of Programming Languages.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
PZ01A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ01A -- Introduction Programming Language Design and.
There are only 10 types of people in the world, those who understand binary and those who don't.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
High-Level Programming Languages: C++
信息处理技术.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Programming Paradigms
Tranlators. Machine Language The lowest-level programming languageprogramming language Machine languages are the only languages understood by computers.languagescomputers.
Programming Language Rico Yu. Levels of Programming Languages 1.Low level languages 2.High level languages.
Evolution of Programming Languages Generations of PLs.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
CS101 Introduction to Computing Lecture Programming Languages.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Visual C++ Programming: Concepts and Projects
Chapter 6 Programming Languages. © 2005 Pearson Addison-Wesley. All rights reserved 6-2 Chapter 6: Programming Languages 6.1 Historical Perspective 6.2.
Chapter 6 Programming Languages © 2007 Pearson Addison-Wesley. All rights reserved.
CSC425 - Introduction To Computer Programming 1. 2 Generation Of Programming Languages A set of rules that telling a computer what to do. There are over.
1 Programming Languages Fundamentals Cao Hoaøng Truï Khoa Coâng Ngheä Thoâng Tin Ñaïi Hoïc Baùch Khoa TP. HCM.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
PROGRAMMING LANGUAGES
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
CS-303 Introduction to Programming
Programming Languages
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
CONCEPTS OF PROGRAMMING LANGUAGES
Introduction to Language Programming Hierarchy of programming lang. Based on machine independences: 1. Machine language 2. Assembly language 3. Higher.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
Programming Languages Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
High-level language programming paradigms. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
Programming Language Paradigms ITSK2314 Lecture 3.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
Programming Languages 2nd edition Tucker and Noonan
CSCI-235 Micro-Computer Applications
An Introduction to Programming
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Principles of Programming Languages
Overview of Programming Paradigms
An Introduction to Programming
Presentation transcript:

Overview of Programming Paradigms Lecture Objectives: Be able to explain the differences between programming languages and programming paradigms. Be able to differentiate between low-level and high-level programming languages and their associated advantages and disadvantages Be able to list four programming paradigms and describe their strengths and weaknesses. Introduction to Computer Programming Programming Languages Programming Paradigms Exercises

Computer Programming The functions of a computer system are controlled by computer programs A computer program is a clear, step-by-step, finite set of instructions A computer program must be clear so that only one meaning can be derived from it, A computer program is written in a computer language called a programming language

Programming Languages There are three categories of programming languages: 1.      Machine languages. 2.      Assembly languages. 3.      High-level languages. Machine languages and assembly languages are also called low-level languages

Programming Languages (cont’d) A Machine language program consists of a sequence of zeros and ones. Each kind of CPU has its own machine language. Advantages Fast and efficient Machine oriented No translation required Disadvantages Not portable Not programmer friendly

Assembly Language Assembly language programs use mnemonics to represent machine instructions Each statement in assembly language corresponds to one statement in machine language. Assembly language programs have the same advantages and disadvantages as machine language programs. Compare the following machine language and assembly language programs: 8086 Machine language program for var1 = var1 + var2 ; 8086 Assembly program for 1010 0001 0000 0000 0000 0000 0000 0011 0000 0110 0000 0000 0000 0010 1010 0011 0000 0000 0000 0000 MOV AX , var1 ADD AX , var2 MOV var1 , AX

High-Level Programming Languages A high-level language (HLL) has two primary components (1) a set of built-in language primitives and grammatical rules (2) a translator A HLL language program consists of English-like statements that are governed by a strict syntax. Advantages Portable or machine independent Programmer-friendly Disadvantages Not as efficient as low-level languages Need to be translated Examples : C, C++, Java, FORTRAN, Visual Basic, and Delphi.

Programming Paradigms Why are there hundreds of programming languages in use today? Some programming languages are specifically designed for use in certain applications. Different programming languages follow different approaches to solving programming problems A programming paradigm is an approach to solving programming problems. A programming paradigm may consist of many programming languages. Common programming paradigms: Imperative or Procedural Programming Object-Oriented Programming Functional Programming Logic Programming

Programming Paradigms: Imperative In this paradigm, a program is a series of statements containing variables. Program execution involves changing the memory contents of the computer continuously. Example of imperative languages are: C, FORTRAN, Pascal, COBOL etc Advantages low memory utilization relatively efficient the most common form of programming in use today. Disadvantages difficulty of reasoning about programs difficulty of parallelization. Tend to be relatively low level.

Programming Paradigms: Object-Oriented A program in this paradigm consists of objects which communicate with each other by sending messages Example object oriented languages include: Java, C#, Smalltalk, etc Advantages Conceptual simplicity Models computation better Increased productivity. Disadvantages Can have a steep learning curve, initially Doing I/O can be cumbersome

Programming Paradigms: Functional A program in this paradigm consists of functions and uses functions in a similar way as used in mathematics Program execution involves functions calling each other and returning results. There are no variables in functional languages. Example functional languages include: ML, MirandaTM, Haskell Advantages Small and clean syntax Better support for reasoning about programs They allow functions to be treated as any other data values. They support programming at a relatively higher level than the imperative languages  Disadvantages Difficulty of doing input-output Functional languages use more storage space than their imperative cousins

Programming Paradigms: Logic A program in the logic paradigm consists of a set of predicates and rules of inference. Predicates are statements of fact like the statement that says: water is wet. Rules of inference are statements like: If X is human then X is mortal. The predicates and the rules of inference are used to prove statements that the programmer supplies. Example: Prolog Advantages Good support for reasoning about programs Can lead to concise solutions to problems  Disadvantages Slow execution Limited view of the world That means the system does not know about facts that are not its predicates and rules of inference. Difficulties in understanding and debugging large programs

Which Programming Paradigm is Best? Which of these paradigms is the best? The most accurate answer is that there is no best paradigm. No single paradigm will fit all problems well. Human beings use a combination of the models represented by these paradigms. Languages with features from different paradigms are often too complex. So, the search of the ultimate programming language continues!

Review Questions List two advantages and two disadvantages of low-level languages. 2. Explain the similarities and differences between an assembly language and a machine language. 3. Mention the programming paradigm to which each of the following languages belongs: Visual Basic, Java, C#, Haskell, Lisp, Prolog, Pascal. 4. Which programming paradigms give better support for reasoning about programs? 5. Which programming paradigms give better support for doing I/O?