Programming Paradigms and Languages Introduction. dr Robert Kowalczyk WMiI UŁ - PDF

Description
Programming Paradigms and Languages Introduction dr Robert Kowalczyk WMiI UŁ What is a programming paradigm? A programming paradigm is a fundamental style of computer programming, a way of building the

Please download to get full document.

View again

of 23
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

Self-Help

Publish on:

Views: 15 | Pages: 23

Extension: PDF | Download: 0

Share
Transcript
Programming Paradigms and Languages Introduction dr Robert Kowalczyk WMiI UŁ What is a programming paradigm? A programming paradigm is a fundamental style of computer programming, a way of building the structure and elements of computer programs. There are two main programming paradigms: imperative programming and declarative programming. source: dr Robert Kowalczyk WMiI UŁ 2 Definitions Imperative programming: telling the machine (computer) how to do something, and as a result what you want to happen will happen. Declarative programming: telling the machine (computer) what you would like to happen, and let the computer figure out how to do it. dr Robert Kowalczyk WMiI UŁ 3 Imperative vs. declarative programming - example We wish to double all the numbers in an array. Imperative style of programming: var numbers = [1,2,3,4,5] var doubled = [] for(var i = 0; i numbers.length; i++) { var newnumber = numbers[i] * 2 doubled.push(newnumber) } console.write(doubled) //= [2,4,6,8,10] Declarative style of programming: var numbers = [1,2,3,4,5] var doubled = numbers.map(function(n) { return n * 2 }) console.log(doubled) //= [2,4,6,8,10] dr Robert Kowalczyk WMiI UŁ 4 Distribution of programming paradygms Programming languages Imperative Declarative Structured Procedural Logical Functional Object-oriented Generic SQL, XML Concurrent dr Robert Kowalczyk WMiI UŁ 5 Four main programming paradyms Procedural/Structured programming Object-oriented programming Functional programming Logical programming dr Robert Kowalczyk WMiI UŁ 6 Procedural/structured programming Procedural programming is a computer programming language that organised our code into small programs that use and change our datas. Structured programming is a programming paradigm recommending hierarchical division into blocks of code with one entry point and one or more exit points. In structured programming we use three main structures : - sequences (instruction _1; instruction _2; ; instruction _n), - choices (if, if...else, switch, case), - iterations (while, repeat, for). Key words: variables, types, procedures and abstract datas. Using: network systems, operating systems, etc. Procedural/structured languages: Fortran Cobol Pascal C C++ others. dr Robert Kowalczyk WMiI UŁ 7 Procedural/structural programming - example dr Robert Kowalczyk WMiI UŁ 8 Object-oriented programming Object-oriented programming is a programming paradigm in which programs are defined using objects - the state of the connecting elements (or fields) and behavior (or method). Object-oriented computer program is expressed as a set of such objects, which communicate with each other in order to perform tasks. Key words: classes and objects, inheritance, encapsulation, polymorphism. Using: www and stand-alone applications. Object-oriented languages Simula, Smalltalk, C++, C#, Java, others. dr Robert Kowalczyk WMiI UŁ 9 Obcject-oriented programming - example dr Robert Kowalczyk WMiI UŁ 10 Functional programming Functional programming is a programming paradigm in which the functions are the core values and the emphasis is on valuation (often recursive) function, and not to execute commands. Theoretical basis for functional programming was developed in the 30thTwentieth century by Alonzo Church's lambda calculus, namely lambda calculus with types. Key words: functions, lambda calculus, parametric polymorphism. Using: theoretical, in telecommunications, in financial calculations. Functional languages: Lisp, ML, Haskell, H#, Erlang others. dr Robert Kowalczyk WMiI UŁ 11 Functional programming - example dr Robert Kowalczyk WMiI UŁ 12 Logical programming The paradigm of logic programming is a programming method in which the program is given as a set of relations, and the relationship between these dependencies. Key words: facts, reports, queries. Using: theoretical, artificial intelligence. Logical languages: Gödel, Fril, Prolog, others. dr Robert Kowalczyk WMiI UŁ 13 Logical programming - example dr Robert Kowalczyk WMiI UŁ 14 TIOBE index popularaity of progrmaming languages source: dr Robert Kowalczyk WMiI UŁ 15 C/C++ (schedule) Introduction to the course (18th February) Revision C++ langue (25th February) dr Robert Kowalczyk WMiI UŁ 16 Haskell (schedule) Starting out (me) (4th March) Types and Typeclasses + Syntax in Functions (student) (11-18th March) Alberto Leon Recursion + higher order functions (student) (25-8th April) Alexander & Irakli Modules + Input and Output (student) (15th April) Ayush and Oleksii Revision Haskell language (15th April) Haskell test (22th April) We refer the chapters of the book Learn You a Haskell for Great Good! By Miron Lipovaca dr Robert Kowalczyk WMiI UŁ 17 Prolog (schedule) Introducing Prolog (me) (6th May) Constructing Prolog Programs (student) (13th May) Ali Rostamani & Rajasekaran Karavnanithi Data Structures and Computation (student) (20th May) Aisha Younus, Radhwan aljawadi, Qusay Alanoz Expressing Procedural Algorithms + Advanced Techniques (student) (27th May) Baqir Mazher & Almas Tynysh Prolog test (3th June) We refer the chapters of the book Prolog Programming in Depth by Michael A. Covington, Donald Nute, André Vellino dr Robert Kowalczyk WMiI UŁ 18 Schedule for classes Finishing classes and retake tests (3th June) dr Robert Kowalczyk WMiI UŁ 19 Marks To pass the class: 1 lecture + 2 tests (Haskell+Prolog) dr Robert Kowalczyk WMiI UŁ 20 Main rules for classes Pass classes: lecture plus two tests My website: My office room: A327 My work hours: Wednesday 2pm-4m 1 class introduction 1 classes revision C++ 1 class my Haskell lecture 3 classes students Haskell lectures 1 class revision to prapere for the Haskell test 1 class the Haskell test 1 class my Prolog lecture 3 classes students Prolog lectures 1 class revision to prapere for the Prolog test 1 class the Prolog test 1 class - finishing classes and retake tests dr Robert Kowalczyk WMiI UŁ 21 Literatute 1. Learn You a Haskell for Great Good! By Miron Lipovaca 2. Prolog Programming in Depth by Michael A. Covington, Donald Nute, André Vellino 3. Any www sites and books dedicated to Haskell and Prolog languages dr Robert Kowalczyk WMiI UŁ 22 Any Quetions? dr Robert Kowalczyk WMiI UŁ 23
Related Search
Similar documents
View more...
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks